From 611a961d58ece58df10b5fa14d9b72817e08d4fe Mon Sep 17 00:00:00 2001 From: Mateusz Loskot <mateusz@loskot.net> Date: Tue, 8 Jul 2008 16:57:00 +0000 Subject: [PATCH] Imported from soci-3.0.0.zip. --- CHANGES | 31 + Makefile | 20 + Makefile.am | 61 - Makefile.in | 697 - README | 8 +- aclocal.m4 | 7261 ----- autogen.sh | 69 - build/msvc80/dll/core.vcproj | 588 +- build/msvc80/dll/maketest.mak | 4 +- build/msvc80/dll/soci_dll.sln | 1 + build/msvc80/dll/sqlite3.vcproj | 484 +- build/msvc80/lib/core.vcproj | 184 +- build/msvc80/lib/soci_lib.sln | 1 + build/msvc80/soci.vsprops | 20 +- build/unix/build-core.tcl | 37 + build/unix/build-mysql.tcl | 142 + build/unix/build-oracle.tcl | 120 + build/unix/build-postgresql.tcl | 148 + build/unix/build.tcl | 82 + build/unix/execute.tcl | 14 + build/unix/find-boost.tcl | 47 + build/unix/install.tcl | 68 + build/unix/parse-parameters.tcl | 60 + config.guess | 1466 -- config.sub | 1579 -- configure | 21941 +--------------- configure.in | 522 - contrib | 25 + depcomp | 530 - doc/backends.html | 306 +- doc/backends/firebird.html | 7 + doc/backends/index.html | 4 +- doc/backends/mysql.html | 82 +- doc/backends/odbc.html | 6 + doc/backends/oracle.html | 129 +- doc/backends/postgresql.html | 89 +- doc/backends/sqlite3.html | 10 +- doc/basics.html | 65 +- doc/beyond.html | 28 +- doc/boost.html | 106 + doc/errors.html | 48 +- doc/exchange.html | 397 +- doc/index.html | 15 +- doc/interfaces.html | 102 + doc/multithreading.html | 64 + doc/rationale.html | 30 +- doc/reference.html | 688 +- doc/statements.html | 80 +- doc/structure.html | 120 +- doc/structure.png | Bin 22342 -> 26919 bytes doc/style.css | 3 +- install-sh | 323 - ltmain.sh | 6871 ----- m4/ax_cxx_toolset.m4 | 163 - m4/ax_firebird.m4 | 165 - m4/ax_mysql.m4 | 143 - m4/ax_oracle_oci.m4 | 267 - m4/ax_postgresql.m4 | 142 - m4/ax_sqlite3.m4 | 148 - missing | 360 - src/Makefile.am | 10 - src/Makefile.in | 516 - src/README | 39 - src/backends/Makefile.am | 13 - src/backends/Makefile.in | 520 - src/backends/empty/Makefile.am | 37 - src/backends/empty/Makefile.basic | 88 - src/backends/empty/Makefile.in | 537 - src/backends/empty/blob.cpp | 62 - src/backends/empty/factory.cpp | 27 - src/backends/empty/row-id.cpp | 28 - src/backends/empty/session.cpp | 64 - src/backends/empty/soci-empty.h | 186 - src/backends/empty/standard-into-type.cpp | 40 - src/backends/empty/standard-use-type.cpp | 47 - src/backends/empty/statement.cpp | 98 - src/backends/empty/test/Makefile.am | 26 - src/backends/empty/test/Makefile.basic | 13 - src/backends/empty/test/Makefile.in | 483 - src/backends/empty/test/test-empty.cpp | 156 - src/backends/empty/vector-into-type.cpp | 51 - src/backends/empty/vector-use-type.cpp | 47 - src/backends/firebird/Makefile.am | 41 - src/backends/firebird/Makefile.basic | 99 - src/backends/firebird/Makefile.in | 566 - src/backends/firebird/blob.cpp | 301 - src/backends/firebird/common.cpp | 136 - src/backends/firebird/common.h | 145 - src/backends/firebird/error.cpp | 84 - src/backends/firebird/error.h | 35 - src/backends/firebird/factory.cpp | 19 - src/backends/firebird/row-id.cpp | 23 - src/backends/firebird/session.cpp | 221 - src/backends/firebird/soci-firebird.h | 324 - src/backends/firebird/standard-into-type.cpp | 161 - src/backends/firebird/standard-use-type.cpp | 179 - src/backends/firebird/statement.cpp | 646 - src/backends/firebird/test/Makefile.am | 28 - src/backends/firebird/test/Makefile.basic | 22 - src/backends/firebird/test/Makefile.in | 484 - src/backends/firebird/test/test-firebird.cpp | 1194 - src/backends/firebird/vector-into-type.cpp | 203 - src/backends/firebird/vector-use-type.cpp | 203 - src/backends/mysql/Makefile.am | 39 - src/backends/mysql/Makefile.basic | 6 +- src/backends/mysql/Makefile.in | 561 - src/backends/mysql/blob.cpp | 34 +- src/backends/mysql/common.cpp | 19 +- src/backends/mysql/common.h | 38 +- src/backends/mysql/factory.cpp | 22 +- src/backends/mysql/row-id.cpp | 14 +- src/backends/mysql/session.cpp | 128 +- src/backends/mysql/soci-mysql.h | 174 +- src/backends/mysql/standard-into-type.cpp | 94 +- src/backends/mysql/standard-use-type.cpp | 75 +- src/backends/mysql/statement.cpp | 128 +- src/backends/mysql/test/Makefile.am | 27 - src/backends/mysql/test/Makefile.basic | 2 +- src/backends/mysql/test/Makefile.in | 483 - src/backends/mysql/test/test-mysql.cpp | 299 +- src/backends/mysql/vector-into-type.cpp | 125 +- src/backends/mysql/vector-use-type.cpp | 78 +- src/backends/odbc/Makefile.am | 22 - src/backends/odbc/Makefile.basic | 89 - src/backends/odbc/Makefile.in | 371 - src/backends/odbc/blob.cpp | 58 - src/backends/odbc/factory.cpp | 23 - src/backends/odbc/row-id.cpp | 24 - src/backends/odbc/session.cpp | 148 - src/backends/odbc/soci-odbc.h | 298 - src/backends/odbc/standard-into-type.cpp | 182 - src/backends/odbc/standard-use-type.cpp | 295 - src/backends/odbc/statement.cpp | 310 - src/backends/odbc/test/Makefile.am | 20 - src/backends/odbc/test/Makefile.basic | 24 - src/backends/odbc/test/Makefile.in | 368 - src/backends/odbc/test/test-access.dsn | 13 - src/backends/odbc/test/test-mssql.dsn | 8 - src/backends/odbc/test/test-mysql.dsn | 6 - src/backends/odbc/test/test-odbc-access.cpp | 136 - src/backends/odbc/test/test-odbc-mssql.cpp | 126 - src/backends/odbc/test/test-odbc-mysql.cpp | 126 - .../odbc/test/test-odbc-postgresql.cpp | 127 - src/backends/odbc/test/test-postgresql.dsn | 38 - src/backends/odbc/utility.h | 59 - src/backends/odbc/vector-into-type.cpp | 390 - src/backends/odbc/vector-use-type.cpp | 380 - src/backends/oracle/Makefile.am | 39 - src/backends/oracle/Makefile.basic | 8 +- src/backends/oracle/Makefile.in | 561 - src/backends/oracle/blob.cpp | 37 +- src/backends/oracle/error.cpp | 32 +- src/backends/oracle/error.h | 26 +- src/backends/oracle/factory.cpp | 54 +- src/backends/oracle/row-id.cpp | 14 +- src/backends/oracle/session.cpp | 118 +- src/backends/oracle/soci-oracle.h | 200 +- src/backends/oracle/standard-into-type.cpp | 147 +- src/backends/oracle/standard-use-type.cpp | 454 +- src/backends/oracle/statement.cpp | 103 +- src/backends/oracle/test/Makefile.am | 28 - src/backends/oracle/test/Makefile.basic | 8 +- src/backends/oracle/test/Makefile.in | 484 - src/backends/oracle/test/test-oracle.cpp | 566 +- src/backends/oracle/vector-into-type.cpp | 184 +- src/backends/oracle/vector-use-type.cpp | 147 +- src/backends/postgresql/Makefile.am | 39 - src/backends/postgresql/Makefile.basic | 6 +- src/backends/postgresql/Makefile.in | 563 - src/backends/postgresql/blob.cpp | 59 +- src/backends/postgresql/common.cpp | 32 +- src/backends/postgresql/common.h | 79 +- src/backends/postgresql/factory.cpp | 26 +- src/backends/postgresql/row-id.cpp | 13 +- src/backends/postgresql/session.cpp | 71 +- src/backends/postgresql/soci-postgresql.h | 197 +- .../postgresql/standard-into-type.cpp | 138 +- src/backends/postgresql/standard-use-type.cpp | 97 +- src/backends/postgresql/statement.cpp | 172 +- src/backends/postgresql/test/Makefile.am | 28 - src/backends/postgresql/test/Makefile.basic | 2 +- src/backends/postgresql/test/Makefile.in | 484 - .../postgresql/test/test-postgresql.cpp | 299 +- src/backends/postgresql/vector-into-type.cpp | 136 +- src/backends/postgresql/vector-use-type.cpp | 104 +- src/backends/sqlite3/Makefile.am | 39 - src/backends/sqlite3/Makefile.basic | 95 - src/backends/sqlite3/Makefile.in | 561 - src/backends/sqlite3/blob.cpp | 52 - src/backends/sqlite3/common.cpp | 65 - src/backends/sqlite3/common.h | 44 - src/backends/sqlite3/factory.cpp | 27 - src/backends/sqlite3/row-id.cpp | 28 - src/backends/sqlite3/session.cpp | 100 - src/backends/sqlite3/soci-sqlite3.h | 257 - src/backends/sqlite3/standard-into-type.cpp | 176 - src/backends/sqlite3/standard-use-type.cpp | 198 - src/backends/sqlite3/statement.cpp | 357 - src/backends/sqlite3/test/Makefile.am | 40 - src/backends/sqlite3/test/Makefile.basic | 22 - src/backends/sqlite3/test/Makefile.in | 498 - src/backends/sqlite3/test/test-sqlite3.cpp | 233 - src/backends/sqlite3/vector-into-type.cpp | 185 - src/backends/sqlite3/vector-use-type.cpp | 220 - src/core/Makefile.am | 32 - src/core/Makefile.basic | 72 +- src/core/Makefile.in | 652 - src/core/backend-loader.cpp | 314 + src/core/backend-loader.h | 36 + src/core/blob-exchange.h | 56 + src/core/blob.cpp | 50 + src/core/blob.h | 47 + src/core/boost-fusion.h | 323 + src/core/boost-gregorian-date.h | 46 + src/core/boost-optional.h | 55 + src/core/boost-tuple.h | 317 + src/core/connection-pool.cpp | 325 + src/core/connection-pool.h | 38 + src/core/error.cpp | 17 + src/core/error.h | 27 + src/core/exchange-traits.h | 119 + src/core/into-type.cpp | 105 + src/core/into-type.h | 188 + src/core/into.h | 52 + src/core/once-temp-type.cpp | 53 + src/core/once-temp-type.h | 102 + src/core/prepare-temp-type.cpp | 53 + src/core/prepare-temp-type.h | 51 + src/core/procedure.cpp | 33 + src/core/procedure.h | 89 + src/core/ref-counted-prepare-info.cpp | 46 + src/core/ref-counted-prepare-info.h | 56 + src/core/ref-counted-statement.cpp | 38 + src/core/ref-counted-statement.h | 86 + src/core/row-exchange.h | 75 + src/core/row.cpp | 101 + src/core/row.h | 153 + src/core/rowid-exchange.h | 57 + src/core/rowid.cpp | 23 + src/core/rowid.h | 41 + src/core/rowset.h | 241 + src/core/session.cpp | 377 + src/core/session.h | 114 + src/core/soci-backend.h | 184 +- src/core/soci-config.h | 3 +- src/core/soci-platform.h | 4 +- src/core/soci-simple.cpp | 1813 ++ src/core/soci-simple.h | 136 + src/core/soci.cpp | 1178 - src/core/soci.h | 2246 +- src/core/statement.cpp | 715 + src/core/statement.h | 261 + src/core/test/Makefile.am | 16 - src/core/test/Makefile.in | 414 - src/core/test/common-tests.h | 1977 +- src/core/transaction.cpp | 52 + src/core/transaction.h | 36 + src/core/type-conversion-traits.h | 41 + src/core/type-conversion.h | 295 + src/core/type-holder.h | 65 + src/core/type-ptr.h | 35 + src/core/use-type.cpp | 89 + src/core/use-type.h | 250 + src/core/use.h | 62 + src/core/values-exchange.h | 108 + src/core/values.cpp | 44 + src/core/values.h | 323 + 267 files changed, 16123 insertions(+), 69196 deletions(-) create mode 100644 Makefile delete mode 100644 Makefile.am delete mode 100644 Makefile.in delete mode 100644 aclocal.m4 delete mode 100644 autogen.sh create mode 100644 build/unix/build-core.tcl create mode 100644 build/unix/build-mysql.tcl create mode 100644 build/unix/build-oracle.tcl create mode 100644 build/unix/build-postgresql.tcl create mode 100644 build/unix/build.tcl create mode 100644 build/unix/execute.tcl create mode 100644 build/unix/find-boost.tcl create mode 100644 build/unix/install.tcl create mode 100644 build/unix/parse-parameters.tcl delete mode 100644 config.guess delete mode 100644 config.sub delete mode 100644 configure.in delete mode 100644 depcomp create mode 100644 doc/boost.html create mode 100644 doc/interfaces.html create mode 100644 doc/multithreading.html delete mode 100644 install-sh delete mode 100644 ltmain.sh delete mode 100644 m4/ax_cxx_toolset.m4 delete mode 100644 m4/ax_firebird.m4 delete mode 100644 m4/ax_mysql.m4 delete mode 100644 m4/ax_oracle_oci.m4 delete mode 100644 m4/ax_postgresql.m4 delete mode 100644 m4/ax_sqlite3.m4 delete mode 100644 missing delete mode 100644 src/Makefile.am delete mode 100644 src/Makefile.in delete mode 100644 src/README delete mode 100644 src/backends/Makefile.am delete mode 100644 src/backends/Makefile.in delete mode 100644 src/backends/empty/Makefile.am delete mode 100644 src/backends/empty/Makefile.basic delete mode 100644 src/backends/empty/Makefile.in delete mode 100644 src/backends/empty/blob.cpp delete mode 100644 src/backends/empty/factory.cpp delete mode 100644 src/backends/empty/row-id.cpp delete mode 100644 src/backends/empty/session.cpp delete mode 100644 src/backends/empty/soci-empty.h delete mode 100644 src/backends/empty/standard-into-type.cpp delete mode 100644 src/backends/empty/standard-use-type.cpp delete mode 100644 src/backends/empty/statement.cpp delete mode 100644 src/backends/empty/test/Makefile.am delete mode 100644 src/backends/empty/test/Makefile.basic delete mode 100644 src/backends/empty/test/Makefile.in delete mode 100644 src/backends/empty/test/test-empty.cpp delete mode 100644 src/backends/empty/vector-into-type.cpp delete mode 100644 src/backends/empty/vector-use-type.cpp delete mode 100644 src/backends/firebird/Makefile.am delete mode 100644 src/backends/firebird/Makefile.basic delete mode 100644 src/backends/firebird/Makefile.in delete mode 100644 src/backends/firebird/blob.cpp delete mode 100644 src/backends/firebird/common.cpp delete mode 100644 src/backends/firebird/common.h delete mode 100644 src/backends/firebird/error.cpp delete mode 100644 src/backends/firebird/error.h delete mode 100644 src/backends/firebird/factory.cpp delete mode 100644 src/backends/firebird/row-id.cpp delete mode 100644 src/backends/firebird/session.cpp delete mode 100644 src/backends/firebird/soci-firebird.h delete mode 100644 src/backends/firebird/standard-into-type.cpp delete mode 100644 src/backends/firebird/standard-use-type.cpp delete mode 100644 src/backends/firebird/statement.cpp delete mode 100644 src/backends/firebird/test/Makefile.am delete mode 100644 src/backends/firebird/test/Makefile.basic delete mode 100644 src/backends/firebird/test/Makefile.in delete mode 100644 src/backends/firebird/test/test-firebird.cpp delete mode 100644 src/backends/firebird/vector-into-type.cpp delete mode 100644 src/backends/firebird/vector-use-type.cpp delete mode 100644 src/backends/mysql/Makefile.am delete mode 100644 src/backends/mysql/Makefile.in delete mode 100644 src/backends/mysql/test/Makefile.am delete mode 100644 src/backends/mysql/test/Makefile.in delete mode 100644 src/backends/odbc/Makefile.am delete mode 100644 src/backends/odbc/Makefile.basic delete mode 100644 src/backends/odbc/Makefile.in delete mode 100644 src/backends/odbc/blob.cpp delete mode 100644 src/backends/odbc/factory.cpp delete mode 100644 src/backends/odbc/row-id.cpp delete mode 100644 src/backends/odbc/session.cpp delete mode 100644 src/backends/odbc/soci-odbc.h delete mode 100644 src/backends/odbc/standard-into-type.cpp delete mode 100644 src/backends/odbc/standard-use-type.cpp delete mode 100644 src/backends/odbc/statement.cpp delete mode 100644 src/backends/odbc/test/Makefile.am delete mode 100644 src/backends/odbc/test/Makefile.basic delete mode 100644 src/backends/odbc/test/Makefile.in delete mode 100644 src/backends/odbc/test/test-access.dsn delete mode 100644 src/backends/odbc/test/test-mssql.dsn delete mode 100644 src/backends/odbc/test/test-mysql.dsn delete mode 100644 src/backends/odbc/test/test-odbc-access.cpp delete mode 100644 src/backends/odbc/test/test-odbc-mssql.cpp delete mode 100644 src/backends/odbc/test/test-odbc-mysql.cpp delete mode 100644 src/backends/odbc/test/test-odbc-postgresql.cpp delete mode 100644 src/backends/odbc/test/test-postgresql.dsn delete mode 100644 src/backends/odbc/utility.h delete mode 100644 src/backends/odbc/vector-into-type.cpp delete mode 100644 src/backends/odbc/vector-use-type.cpp delete mode 100644 src/backends/oracle/Makefile.am delete mode 100644 src/backends/oracle/Makefile.in delete mode 100644 src/backends/oracle/test/Makefile.am delete mode 100644 src/backends/oracle/test/Makefile.in delete mode 100644 src/backends/postgresql/Makefile.am delete mode 100644 src/backends/postgresql/Makefile.in delete mode 100644 src/backends/postgresql/test/Makefile.am delete mode 100644 src/backends/postgresql/test/Makefile.in delete mode 100644 src/backends/sqlite3/Makefile.am delete mode 100644 src/backends/sqlite3/Makefile.basic delete mode 100644 src/backends/sqlite3/Makefile.in delete mode 100644 src/backends/sqlite3/blob.cpp delete mode 100644 src/backends/sqlite3/common.cpp delete mode 100644 src/backends/sqlite3/common.h delete mode 100644 src/backends/sqlite3/factory.cpp delete mode 100644 src/backends/sqlite3/row-id.cpp delete mode 100644 src/backends/sqlite3/session.cpp delete mode 100644 src/backends/sqlite3/soci-sqlite3.h delete mode 100644 src/backends/sqlite3/standard-into-type.cpp delete mode 100644 src/backends/sqlite3/standard-use-type.cpp delete mode 100644 src/backends/sqlite3/statement.cpp delete mode 100644 src/backends/sqlite3/test/Makefile.am delete mode 100644 src/backends/sqlite3/test/Makefile.basic delete mode 100644 src/backends/sqlite3/test/Makefile.in delete mode 100644 src/backends/sqlite3/test/test-sqlite3.cpp delete mode 100644 src/backends/sqlite3/vector-into-type.cpp delete mode 100644 src/backends/sqlite3/vector-use-type.cpp delete mode 100644 src/core/Makefile.am delete mode 100644 src/core/Makefile.in create mode 100644 src/core/backend-loader.cpp create mode 100644 src/core/backend-loader.h create mode 100644 src/core/blob-exchange.h create mode 100644 src/core/blob.cpp create mode 100644 src/core/blob.h create mode 100644 src/core/boost-fusion.h create mode 100644 src/core/boost-gregorian-date.h create mode 100644 src/core/boost-optional.h create mode 100644 src/core/boost-tuple.h create mode 100644 src/core/connection-pool.cpp create mode 100644 src/core/connection-pool.h create mode 100644 src/core/error.cpp create mode 100644 src/core/error.h create mode 100644 src/core/exchange-traits.h create mode 100644 src/core/into-type.cpp create mode 100644 src/core/into-type.h create mode 100644 src/core/into.h create mode 100644 src/core/once-temp-type.cpp create mode 100644 src/core/once-temp-type.h create mode 100644 src/core/prepare-temp-type.cpp create mode 100644 src/core/prepare-temp-type.h create mode 100644 src/core/procedure.cpp create mode 100644 src/core/procedure.h create mode 100644 src/core/ref-counted-prepare-info.cpp create mode 100644 src/core/ref-counted-prepare-info.h create mode 100644 src/core/ref-counted-statement.cpp create mode 100644 src/core/ref-counted-statement.h create mode 100644 src/core/row-exchange.h create mode 100644 src/core/row.cpp create mode 100644 src/core/row.h create mode 100644 src/core/rowid-exchange.h create mode 100644 src/core/rowid.cpp create mode 100644 src/core/rowid.h create mode 100644 src/core/rowset.h create mode 100644 src/core/session.cpp create mode 100644 src/core/session.h create mode 100644 src/core/soci-simple.cpp create mode 100644 src/core/soci-simple.h delete mode 100644 src/core/soci.cpp create mode 100644 src/core/statement.cpp create mode 100644 src/core/statement.h delete mode 100644 src/core/test/Makefile.am delete mode 100644 src/core/test/Makefile.in create mode 100644 src/core/transaction.cpp create mode 100644 src/core/transaction.h create mode 100644 src/core/type-conversion-traits.h create mode 100644 src/core/type-conversion.h create mode 100644 src/core/type-holder.h create mode 100644 src/core/type-ptr.h create mode 100644 src/core/use-type.cpp create mode 100644 src/core/use-type.h create mode 100644 src/core/use.h create mode 100644 src/core/values-exchange.h create mode 100644 src/core/values.cpp create mode 100644 src/core/values.h diff --git a/CHANGES b/CHANGES index 4bd53406..a4bb1d84 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,36 @@ This file contains the history of changes in the SOCI library. +--- +Version 3.0.0 differs from 2.2.0 in the following ways: + +- Exposed the session's locale object. + +- Moved the "no data" flag from indicators to statement. + +- Allowed const objects as "use" elements. + +- Added connection mode for Oracle. + +- Added RAII support for transactions. + +- Added the open/close/reconnect functionality. + +- Added support for long long as a fundamental data type. + +- Unified column names for dynamic rowset description, to overcome + differences between database servers. + +- Added the "simple" interface for interfacing from other languages. + +- Added thread-safe connection pool. + +- Added integrated support for Boost data types: gregorian_date, + fusion and tuple. + +- Added dynamic backend loading. + +- Changed the naming convention to comply with Boost recommendations. + --- Version 2.2.0 differs from 2.1.0 in the following ways: diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..dc17931a --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +build_libs : + cd build/unix; `cat local/tcl` build.tcl core core-so mysql mysql-so postgresql postgresql-so oracle oracle-so + +tests : + cd build/unix; `cat local/tcl` build.tcl mysql-test oracle-test postgresql-test + +install : + cd build/unix; `cat local/tcl` install.tcl + +uninstall : + cd build/unix/local; /bin/sh uninstall.sh + +clean : + find . -name '*.o' | xargs rm + find . -name '*.a' | xargs rm + find . -name '*.so' | xargs rm + rm -f src/backends/mysql/test/test-mysql + rm -f src/backends/oracle/test/test-oracle + rm -f src/backends/postgresql/test/test-postgresql + rm -rf build/unix/include build/unix/lib build/unix/tests diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index bd129f5f..00000000 --- a/Makefile.am +++ /dev/null @@ -1,61 +0,0 @@ -# $Id: Makefile.am,v 1.4 2006/11/29 08:38:36 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -AUTOMAKE_OPTIONS = \ - 1.4 \ - foreign \ - dist-bzip2 \ - dist-zip - -SUBDIRS = src - -# Commands -RM = rm -rf -COPY = cp -p - -# Clean patterns -CLEANFILES = *~ - -MAINTAINERCLEANFILES = \ - aclocal.m4 \ - depcomp \ - config.cache \ - config.guess \ - config.h.in \ - config.log \ - config.status \ - config.sub \ - configure \ - install-sh \ - libtool \ - ltmain.sh \ - missing \ - stamp-h.in - -EXTRA_DIST = \ - autogen.sh \ - build \ - doc - -DISTCLEANLOCAL = \ - autom4te.cache - -MAINTAINERCLEANLOCAL = Makefile.in - -dist-hook: - $(COPY) $(top_srcdir)/src/contrib $(distdir) - $(COPY) $(top_srcdir)/src/CHANGES $(distdir) - $(COPY) $(top_srcdir)/src/README $(distdir) - $(COPY) $(top_srcdir)/src/LICENSE_1_0.txt $(distdir) - $(RM) `find $(distdir) -name CVS` - $(RM) `find $(distdir) -name '.cvsignore'` - -distclean-local: - -test -z "$(DISTCLEANLOCAL)" || rm -rf $(DISTCLEANLOCAL) - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) - diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 4ffda97e..00000000 --- a/Makefile.in +++ /dev/null @@ -1,697 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/configure config.guess \ - config.sub depcomp install-sh ltmain.sh missing -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } -DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).zip -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.4 2006/11/29 08:38:36 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -AUTOMAKE_OPTIONS = \ - 1.4 \ - foreign \ - dist-bzip2 \ - dist-zip - -SUBDIRS = src - -# Commands -RM = rm -rf -COPY = cp -p - -# Clean patterns -CLEANFILES = *~ -MAINTAINERCLEANFILES = \ - aclocal.m4 \ - depcomp \ - config.cache \ - config.guess \ - config.h.in \ - config.log \ - config.status \ - config.sub \ - configure \ - install-sh \ - libtool \ - ltmain.sh \ - missing \ - stamp-h.in - -EXTRA_DIST = \ - autogen.sh \ - build \ - doc - -DISTCLEANLOCAL = \ - autom4te.cache - -MAINTAINERCLEANLOCAL = Makefile.in -all: all-recursive - -.SUFFIXES: -am--refresh: - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - $(am__remove_distdir) - mkdir $(distdir) - $(mkdir_p) $(distdir)/m4 - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' -distuninstallcheck: - @cd $(distuninstallcheck_dir) \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -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-local distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-libtool clean-recursive \ - ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-generic distclean-libtool distclean-local \ - distclean-recursive distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-local maintainer-clean-recursive mostlyclean \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-info-am - - -dist-hook: - $(COPY) $(top_srcdir)/src/contrib $(distdir) - $(COPY) $(top_srcdir)/src/CHANGES $(distdir) - $(COPY) $(top_srcdir)/src/README $(distdir) - $(COPY) $(top_srcdir)/src/LICENSE_1_0.txt $(distdir) - $(RM) `find $(distdir) -name CVS` - $(RM) `find $(distdir) -name '.cvsignore'` - -distclean-local: - -test -z "$(DISTCLEANLOCAL)" || rm -rf $(DISTCLEANLOCAL) - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/README b/README index 5d83faad..3666448e 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ SOCI - The C++ Database Access Library. -Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, +Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton, David Courtney, Pawel Aleksander Fedorynski, Rafal Bobrowski, Mateusz Loskot @@ -14,18 +14,14 @@ You should see the following files and directories here: - README - This file. - LICENSE_1_0.txt - Full text of the Boost license. - CHANGES - The description of changes. -- contrib - Acknowledgements for contributions. -- configure - The main auto-configuration script - this is accompanied - by other files in this directory. +- contrib - Acknowledgements for contributions. - doc/ - Documentation. - build/ - Additional build scripts and configuration files for various compilation systems. -- m4/ - Macros for autotools. - - src/ - The source code of the library. - src/core/ - The main part of the SOCI library. diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index d567150d..00000000 --- a/aclocal.m4 +++ /dev/null @@ -1,7261 +0,0 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 48 Debian 1.5.22-2 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -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 "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[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 avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])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_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$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. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$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 conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# 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. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -[$]* -EOF - exit 0 -fi - -# 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 - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && 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 which ABI we are using. - 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 which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; 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* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - 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-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|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-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - 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_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - 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*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # 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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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 conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# 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*) - # 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; - ;; - - 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; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # 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 - ;; - - 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 - ;; - *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - 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` - ;; - 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 -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# ------------------ -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# --------------------------------------------------------------------- -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -[#line __oline__ "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -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_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ---------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; 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*) - 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 - ]) - ;; - - *) - 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="-dld"], - [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="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && 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_AC_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 "x$lt_cv_dlopen_self" = xyes; 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_AC_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 -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:__oline__: $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:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_AC_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 .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; 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 "$hard_links" = no; 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 -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_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 -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[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" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; 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 - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.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}' - else - # 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' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-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='GNU ld.so' - ;; - -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[[123]]*) 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} $libname${shared_ext}' - 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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 "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - 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' - ;; - -interix3*) - 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' - 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 "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - 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 - ;; - -# This must be Linux ELF. -linux*) - 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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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 - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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' - ;; - -knetbsd*-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='GNU ld.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 - 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=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=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - 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 - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -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" - ;; - -solaris*) - 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=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 "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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=freebsd-elf - 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 - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -# set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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 - -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 -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_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 - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; 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 "$with_gnu_ld" = yes; 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 </dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break - ;; - *) - test "$with_gnu_ld" != yes && break - ;; - esac - fi - done - IFS="$lt_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$lt_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -])# AC_PROG_LD - - -# AC_PROG_LD_GNU -# -------------- -AC_DEFUN([AC_PROG_LD_GNU], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac]) -with_gnu_ld=$lt_cv_prog_gnu_ld -])# AC_PROG_LD_GNU - - -# AC_PROG_LD_RELOAD_FLAG -# ---------------------- -# find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], -[AC_CACHE_CHECK([for $LD option to reload object files], - lt_cv_ld_reload_flag, - [lt_cv_ld_reload_flag='-r']) -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 - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac -])# AC_PROG_LD_RELOAD_FLAG - - -# AC_DEPLIBS_CHECK_METHOD -# ----------------------- -# how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognise 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 -# which 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 -aix4* | aix5*) - 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'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | kfreebsd*-gnu | 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 - ;; - -gnu*) - 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]) 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 - ;; - -interix3*) - # 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 Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu | knetbsd*-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=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 - ;; - -solaris*) - 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 - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -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 -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible 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 - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - 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 - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-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_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# ------------------ -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# ------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[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_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF - -# Report which 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 "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - 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 "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_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_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++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_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 "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_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_AC_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 "\-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_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; 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 - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - 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_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; 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 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_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_AC_SYS_LIBPATH_AIX - _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_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 (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_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' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_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 $output_objdir/$soname = $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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - ;; - *) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_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; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_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_AC_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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - 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_AC_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_AC_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; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_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' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_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=`echo $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; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_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::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_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_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_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=`echo $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; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_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 "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_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=`echo $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; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_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 "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # 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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -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 \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_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 -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 \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_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 can NOT 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. - # 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. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -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 -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([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. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -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... -ifelse([$1],[],[cat > conftest.$ac_ext <<EOF -int a; -void foo (void) { a = 0; } -EOF -],[$1],[CXX],[cat > conftest.$ac_ext <<EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -EOF -],[$1],[F77],[cat > conftest.$ac_ext <<EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -EOF -],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -EOF -]) -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 - - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` - - for p in `eval $output_verbose_link_cmd`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p 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_AC_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then - _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - ;; - - *.$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 "$pre_test_object_deps_done" = no; then - if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then - _LT_AC_TAGVAR(predep_objects, $1)="$p" - else - _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then - _LT_AC_TAGVAR(postdep_objects, $1)="$p" - else - _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_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 - -# PORTME: override above test on systems where it is broken -ifelse([$1],[CXX], -[case $host_os in -interix3*) - # 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_AC_TAGVAR(predep_objects,$1)= - _LT_AC_TAGVAR(postdep_objects,$1)= - _LT_AC_TAGVAR(postdeps,$1)= - ;; - -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' - ;; - esac - ;; -esac -]) - -case " $_LT_AC_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac -])# AC_LIBTOOL_POSTDEP_PREDEP - -# AC_LIBTOOL_LANG_F77_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) -AC_DEFUN([_LT_AC_LANG_F77_CONFIG], -[AC_REQUIRE([AC_PROG_F77]) -AC_LANG_PUSH(Fortran 77) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_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_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_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" -CC=${F77-"f77"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - 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 "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -_LT_AC_TAGVAR(GCC, $1)="$G77" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_F77_CONFIG - - -# AC_LIBTOOL_LANG_GCJ_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) -AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], -[AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_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" -CC=${GCJ-"gcj"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_RESTORE -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_GCJ_CONFIG - - -# AC_LIBTOOL_LANG_RC_CONFIG -# ------------------------- -# Ensure that the configuration vars for the Windows resource compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) -AC_DEFUN([_LT_AC_LANG_RC_CONFIG], -[AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# 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_AC_SYS_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" -CC=${RC-"windres"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_RESTORE -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_RC_CONFIG - - -# AC_LIBTOOL_CONFIG([TAGNAME]) -# ---------------------------- -# If TAGNAME is not passed, then 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 -# TAGNAME from the matching tagged config vars. -AC_DEFUN([AC_LIBTOOL_CONFIG], -[# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - _LT_AC_TAGVAR(compiler, $1) \ - _LT_AC_TAGVAR(CC, $1) \ - _LT_AC_TAGVAR(LD, $1) \ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ - _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ - _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ - _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ - _LT_AC_TAGVAR(old_archive_cmds, $1) \ - _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ - _LT_AC_TAGVAR(predep_objects, $1) \ - _LT_AC_TAGVAR(postdep_objects, $1) \ - _LT_AC_TAGVAR(predeps, $1) \ - _LT_AC_TAGVAR(postdeps, $1) \ - _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ - _LT_AC_TAGVAR(archive_cmds, $1) \ - _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ - _LT_AC_TAGVAR(postinstall_cmds, $1) \ - _LT_AC_TAGVAR(postuninstall_cmds, $1) \ - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ - _LT_AC_TAGVAR(allow_undefined_flag, $1) \ - _LT_AC_TAGVAR(no_undefined_flag, $1) \ - _LT_AC_TAGVAR(export_symbols_cmds, $1) \ - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ - _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ - _LT_AC_TAGVAR(hardcode_automatic, $1) \ - _LT_AC_TAGVAR(module_cmds, $1) \ - _LT_AC_TAGVAR(module_expsym_cmds, $1) \ - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ - _LT_AC_TAGVAR(exclude_expsyms, $1) \ - _LT_AC_TAGVAR(include_expsyms, $1); do - - case $var in - _LT_AC_TAGVAR(old_archive_cmds, $1) | \ - _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ - _LT_AC_TAGVAR(archive_cmds, $1) | \ - _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ - _LT_AC_TAGVAR(module_cmds, $1) | \ - _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ - _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\[$]0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` - ;; - esac - -ifelse([$1], [], - [cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - AC_MSG_NOTICE([creating $ofile])], - [cfgfile="$ofile"]) - - cat <<__EOF__ >> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 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. - -# 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//" - -# 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 - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\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 "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # 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" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# 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]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - 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 - -# 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 - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -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 <<EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <<EOF >> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_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_save_LIBS" - CFLAGS="$lt_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 -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; 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 -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix3*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # 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*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_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 - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - interix3*) - # 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_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - kfreebsd*-gnu) - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - ;; - linux*) - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # 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 "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; 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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_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' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_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 (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_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_AC_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_AC_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' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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_AC_TAGVAR(ld_shlibs, $1)=no - cat <<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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** 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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | 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 - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - 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_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; 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 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_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_AC_SYS_LIBPATH_AIX - _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $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_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # GNU/kFreeBSD uses gcc -shared to do shared libraries. - kfreebsd*-gnu) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_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 "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_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~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_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' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_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 can NOT 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_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_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_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include <windows.h> -# #undef WIN32_LEAN_AND_MEAN -# #include <stdio.h> -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include <cygwin/cygwin_dll.h> -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -# 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. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_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 -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 $lt_ac_count -gt 10 && 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_MSG_RESULT([$SED]) -]) - -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 7 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 3 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 12 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -]) -]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar <conftest.tar]) - grep GrepMe conftest.dir/file >/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([m4/ax_cxx_toolset.m4]) -m4_include([m4/ax_firebird.m4]) -m4_include([m4/ax_mysql.m4]) -m4_include([m4/ax_oracle_oci.m4]) -m4_include([m4/ax_postgresql.m4]) -m4_include([m4/ax_sqlite3.m4]) diff --git a/autogen.sh b/autogen.sh deleted file mode 100644 index 733b6547..00000000 --- a/autogen.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: autogen.sh,v 1.2 2006/11/23 01:35:49 mloskot Exp $ -# -# Run this to generate all the initial makefiles, etc. -# This was lifted from the Gimp, and adapted slightly -# by Raph Levien -# -# Customized for C++/Tk by Mateusz Loskot <mateusz@loskot.net> -# -DIE=0 - -PROJECT="SOCI" - -for libtoolize in glibtoolize libtoolize; do - LIBTOOLIZE=`which $libtoolize 2>/dev/null` - if test "$LIBTOOLIZE"; then - break; - fi -done - -if test -d "autom4te.cache"; then - rm -rf autom4te.cache -fi - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have autoconf installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/autoconf/" - DIE=1 -} - -($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have libtool installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/libtool/" - DIE=1 -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have automake installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/automake/" - DIE=1 -} - -(aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have aclocal installed to compile $PROJECT." - echo "aclocal is installed together with automake, so" - echo "get latest version from ftp://ftp.gnu.org/pub/gnu/automake/" - DIE=1 -} -if test "$DIE" -eq 1; then - exit 1 -fi - -echo "Running aclocal..." -aclocal -I m4 -echo "Running libtoolize..." -$LIBTOOLIZE --force --copy -echo "Running automake..." -automake --add-missing --copy -echo "Running autoconf..." -autoconf - -echo -echo "Now type './configure' to generate Makefile files for $PROJECT." -echo "Run './configure --help' to get list of possible options." - diff --git a/build/msvc80/dll/core.vcproj b/build/msvc80/dll/core.vcproj index ee64aa88..0fc9bf77 100644 --- a/build/msvc80/dll/core.vcproj +++ b/build/msvc80/dll/core.vcproj @@ -1,214 +1,374 @@ -<?xml version="1.0" encoding="windows-1250"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="core" - ProjectGUID="{13EEEA4E-93A3-4A00-A85B-636E18506F2A}" - RootNamespace="core" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ProjectName)\$(ConfigurationName)" - ConfigurationType="2" - InheritedPropertySheets=".\soci_dll.vsprops" - CharacterSet="2" - BuildLogFile="$(IntDir)\BuildLog.htm" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile="$(OutDir)\$(SOCI_CORE_DEBUG).dll" - LinkIncremental="2" - GenerateDebugInformation="true" - SubSystem="2" - ImportLibrary="$(TargetDir)$(TargetName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ProjectName)\$(ConfigurationName)" - ConfigurationType="2" - InheritedPropertySheets=".\soci_dll.vsprops" - CharacterSet="2" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile="$(OutDir)\$(SOCI_CORE_RELEASE).dll" - LinkIncremental="1" - GenerateDebugInformation="true" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath="$(SOCI_CORE_DIR)\soci.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath="$(SOCI_CORE_DIR)\soci-backend.h" - > - </File> - <File - RelativePath="..\..\..\src\core\soci-config.h" - > - </File> - <File - RelativePath="$(SOCI_CORE_DIR)\soci.h" - > - </File> - </Filter> - <Filter - Name="test" - > - <File - RelativePath="..\..\..\src\core\test\common-tests.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> +<?xml version="1.0" encoding="windows-1250"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="core" + ProjectGUID="{13EEEA4E-93A3-4A00-A85B-636E18506F2A}" + RootNamespace="core" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ProjectName)\$(ConfigurationName)" + ConfigurationType="2" + InheritedPropertySheets=".\soci_dll.vsprops" + CharacterSet="2" + BuildLogFile="$(IntDir)\BuildLog.htm" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\$(SOCI_CORE_DEBUG).dll" + LinkIncremental="2" + GenerateDebugInformation="true" + SubSystem="2" + ImportLibrary="$(TargetDir)$(TargetName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ProjectName)\$(ConfigurationName)" + ConfigurationType="2" + InheritedPropertySheets=".\soci_dll.vsprops" + CharacterSet="2" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS" + RuntimeLibrary="2" + UsePrecompiledHeader="0" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\$(SOCI_CORE_RELEASE).dll" + LinkIncremental="1" + GenerateDebugInformation="true" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\..\src\core\blob.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\error.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\into-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\once-temp-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\prepare-temp-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\procedure.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\ref-counted-prepare-info.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\ref-counted-statement.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\row.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\rowid.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\session.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\statement.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\use-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\values.cpp" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath="..\..\..\src\core\blob-exchange.h" + > + </File> + <File + RelativePath="..\..\..\src\core\blob.h" + > + </File> + <File + RelativePath="..\..\..\src\core\boost-optional.h" + > + </File> + <File + RelativePath="..\..\..\src\core\exchange-traits.h" + > + </File> + <File + RelativePath="..\..\..\src\core\into-type.h" + > + </File> + <File + RelativePath="..\..\..\src\core\into.h" + > + </File> + <File + RelativePath="..\..\..\src\core\once-temp-type.h" + > + </File> + <File + RelativePath="..\..\..\src\core\prepare-temp-type.h" + > + </File> + <File + RelativePath="..\..\..\src\core\procedure.h" + > + </File> + <File + RelativePath="..\..\..\src\core\ref-counted-prepare-info.h" + > + </File> + <File + RelativePath="..\..\..\src\core\ref-counted-statement.h" + > + </File> + <File + RelativePath="..\..\..\src\core\row-exchange.h" + > + </File> + <File + RelativePath="..\..\..\src\core\row.h" + > + </File> + <File + RelativePath="..\..\..\src\core\rowid-exchange.h" + > + </File> + <File + RelativePath="..\..\..\src\core\rowid.h" + > + </File> + <File + RelativePath="..\..\..\src\core\rowset.h" + > + </File> + <File + RelativePath="..\..\..\src\core\session.h" + > + </File> + <File + RelativePath="..\..\..\src\core\soci-backend.h" + > + </File> + <File + RelativePath="..\..\..\src\core\soci-config.h" + > + </File> + <File + RelativePath="..\..\..\src\core\soci-platform.h" + > + </File> + <File + RelativePath="..\..\..\src\core\soci.h" + > + </File> + <File + RelativePath="..\..\..\src\core\statement.h" + > + </File> + <File + RelativePath="..\..\..\src\core\type-conversion-traits.h" + > + </File> + <File + RelativePath="..\..\..\src\core\type-conversion.h" + > + </File> + <File + RelativePath="..\..\..\src\core\type-holder.h" + > + </File> + <File + RelativePath="..\..\..\src\core\type-ptr.h" + > + </File> + <File + RelativePath="..\..\..\src\core\use-type.h" + > + </File> + <File + RelativePath="..\..\..\src\core\use.h" + > + </File> + <File + RelativePath="..\..\..\src\core\values-exchange.h" + > + </File> + <File + RelativePath="..\..\..\src\core\values.h" + > + </File> + </Filter> + <Filter + Name="test" + > + <File + RelativePath="..\..\..\src\core\test\common-tests.h" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/build/msvc80/dll/maketest.mak b/build/msvc80/dll/maketest.mak index 4b53da43..7d2c9440 100644 --- a/build/msvc80/dll/maketest.mak +++ b/build/msvc80/dll/maketest.mak @@ -1,4 +1,4 @@ -# $Id: maketest.mak,v 1.2 2006/11/13 15:47:48 mloskot Exp $ +# $Id: maketest.mak,v 1.3 2007/08/17 02:30:40 mloskot Exp $ # # Makefile to run SOCI tests using NMAKE utility on Windows. # @@ -19,7 +19,7 @@ # # Here, define connection settings for your environment # -FIREBIRD_CONN="service=\\.\D:\data\soci\SOCI_TEST.FDB user=sysdba password=buildbot" +FIREBIRD_CONN="service=\\.\D:\dev\soci\data\SOCI_TEST.FDB user=sysdba password=masterkey" MYSQL_CONN="" ODBC_ACCESS_CONN="FILEDSN=D:\data\soci\test-access.dsn" ODBC_MSSQL_CONN="FILEDSN=D:\data\soci\test-mssql.dsn" diff --git a/build/msvc80/dll/soci_dll.sln b/build/msvc80/dll/soci_dll.sln index a004722b..8684c0e4 100644 --- a/build/msvc80/dll/soci_dll.sln +++ b/build/msvc80/dll/soci_dll.sln @@ -90,6 +90,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7706D9FD-B4D5-49E5-AC10-201F4DBF5E76}" ProjectSection(SolutionItems) = preProject maketest.mak = maketest.mak + ..\README.txt = ..\README.txt EndProjectSection EndProject Global diff --git a/build/msvc80/dll/sqlite3.vcproj b/build/msvc80/dll/sqlite3.vcproj index dbca1a66..51ddcead 100644 --- a/build/msvc80/dll/sqlite3.vcproj +++ b/build/msvc80/dll/sqlite3.vcproj @@ -1,242 +1,242 @@ -<?xml version="1.0" encoding="windows-1250"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="sqlite3" - ProjectGUID="{BDFE40A0-2D9C-4F46-A94C-22BBA7F07D9F}" - RootNamespace="sqlite3" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ProjectName)\$(ConfigurationName)" - ConfigurationType="2" - InheritedPropertySheets=".\soci_dll.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SQLITE3_INCLUDE_DIR)" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SQLITE3_EXPORTS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - Detect64BitPortabilityProblems="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="$(SQLITE3_LIB)" - OutputFile="$(OutDir)\$(SOCI_SQLITE3_DEBUG).dll" - LinkIncremental="2" - AdditionalLibraryDirectories="$(SQLITE3_LIB_DIR)" - GenerateDebugInformation="true" - SubSystem="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ProjectName)\$(ConfigurationName)" - ConfigurationType="2" - InheritedPropertySheets=".\soci_dll.vsprops" - CharacterSet="2" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="$(SQLITE3_INCLUDE_DIR)" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SQLITE3_EXPORTS" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="$(SQLITE3_LIB)" - OutputFile="$(OutDir)\$(SOCI_SQLITE3_RELEASE).dll" - LinkIncremental="1" - AdditionalLibraryDirectories="$(SQLITE3_LIB_DIR)" - GenerateDebugInformation="true" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\blob.cpp" - > - </File> - <File - RelativePath="..\..\..\src\backends\sqlite3\common.cpp" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\factory.cpp" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\row-id.cpp" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\session.cpp" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\standard-into-type.cpp" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\standard-use-type.cpp" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\statement.cpp" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\vector-into-type.cpp" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\vector-use-type.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath="..\..\..\src\backends\sqlite3\common.h" - > - </File> - <File - RelativePath="$(SOCI_BACKENDS_DIR)\sqlite3\soci-sqlite3.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> +<?xml version="1.0" encoding="windows-1250"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="sqlite3" + ProjectGUID="{BDFE40A0-2D9C-4F46-A94C-22BBA7F07D9F}" + RootNamespace="sqlite3" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ProjectName)\$(ConfigurationName)" + ConfigurationType="2" + InheritedPropertySheets=".\soci_dll.vsprops" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="$(SQLITE3_INCLUDE_DIR)" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SQLITE3_EXPORTS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + Detect64BitPortabilityProblems="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="$(SQLITE3_LIB)" + OutputFile="$(OutDir)\$(SOCI_SQLITE3_DEBUG).dll" + LinkIncremental="2" + AdditionalLibraryDirectories="$(SQLITE3_LIB_DIR)" + GenerateDebugInformation="true" + SubSystem="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ProjectName)\$(ConfigurationName)" + ConfigurationType="2" + InheritedPropertySheets=".\soci_dll.vsprops" + CharacterSet="2" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="$(SQLITE3_INCLUDE_DIR)" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SQLITE3_EXPORTS" + RuntimeLibrary="2" + UsePrecompiledHeader="0" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="$(SQLITE3_LIB)" + OutputFile="$(OutDir)\$(SOCI_SQLITE3_RELEASE).dll" + LinkIncremental="1" + AdditionalLibraryDirectories="$(SQLITE3_LIB_DIR)" + GenerateDebugInformation="true" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\..\src\backends\sqlite3\blob.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\common.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\factory.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\row-id.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\session.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\standard-into-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\standard-use-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\statement.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\vector-into-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\vector-use-type.cpp" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath="..\..\..\src\backends\sqlite3\common.h" + > + </File> + <File + RelativePath="..\..\..\src\backends\sqlite3\soci-sqlite3.h" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/build/msvc80/lib/core.vcproj b/build/msvc80/lib/core.vcproj index 11bcbbfb..7d005cf9 100644 --- a/build/msvc80/lib/core.vcproj +++ b/build/msvc80/lib/core.vcproj @@ -149,6 +149,82 @@ Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" > + <File + RelativePath="..\..\..\src\core\backend-loader.h" + > + </File> + <File + RelativePath="..\..\..\src\core\blob-exchange.h" + > + </File> + <File + RelativePath="..\..\..\src\core\blob.h" + > + </File> + <File + RelativePath="..\..\..\src\core\connection-pool.h" + > + </File> + <File + RelativePath="..\..\..\src\core\error.h" + > + </File> + <File + RelativePath="..\..\..\src\core\exchange-traits.h" + > + </File> + <File + RelativePath="..\..\..\src\core\into-type.h" + > + </File> + <File + RelativePath="..\..\..\src\core\into.h" + > + </File> + <File + RelativePath="..\..\..\src\core\once-temp-type.h" + > + </File> + <File + RelativePath="..\..\..\src\core\prepare-temp-type.h" + > + </File> + <File + RelativePath="..\..\..\src\core\procedure.h" + > + </File> + <File + RelativePath="..\..\..\src\core\ref-counted-prepare-info.h" + > + </File> + <File + RelativePath="..\..\..\src\core\ref-counted-statement.h" + > + </File> + <File + RelativePath="..\..\..\src\core\row-exchange.h" + > + </File> + <File + RelativePath="..\..\..\src\core\row.h" + > + </File> + <File + RelativePath="..\..\..\src\core\rowid-exchange.h" + > + </File> + <File + RelativePath="..\..\..\src\core\rowid.h" + > + </File> + <File + RelativePath="..\..\..\src\core\rowset.h" + > + </File> + <File + RelativePath="..\..\..\src\core\session.h" + > + </File> <File RelativePath="$(SOCI_CORE_DIR)\soci-backend.h" > @@ -165,6 +241,46 @@ RelativePath="$(SOCI_CORE_DIR)\soci.h" > </File> + <File + RelativePath="..\..\..\src\core\statement.h" + > + </File> + <File + RelativePath="..\..\..\src\core\transaction.h" + > + </File> + <File + RelativePath="..\..\..\src\core\type-conversion-traits.h" + > + </File> + <File + RelativePath="..\..\..\src\core\type-conversion.h" + > + </File> + <File + RelativePath="..\..\..\src\core\type-holder.h" + > + </File> + <File + RelativePath="..\..\..\src\core\type-ptr.h" + > + </File> + <File + RelativePath="..\..\..\src\core\use-type.h" + > + </File> + <File + RelativePath="..\..\..\src\core\use.h" + > + </File> + <File + RelativePath="..\..\..\src\core\values-exchange.h" + > + </File> + <File + RelativePath="..\..\..\src\core\values.h" + > + </File> </Filter> <Filter Name="test" @@ -179,11 +295,75 @@ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" > <File - RelativePath="$(SOCI_CORE_DIR)\soci.cpp" + RelativePath="..\..\..\src\core\backend-loader.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\blob.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\connection-pool.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\error.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\into-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\once-temp-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\prepare-temp-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\procedure.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\ref-counted-prepare-info.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\ref-counted-statement.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\row.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\rowid.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\session.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\statement.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\transaction.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\use-type.cpp" + > + </File> + <File + RelativePath="..\..\..\src\core\values.cpp" > </File> </Filter> </Files> <Globals> </Globals> -</VisualStudioProject> +</VisualStudioProject> \ No newline at end of file diff --git a/build/msvc80/lib/soci_lib.sln b/build/msvc80/lib/soci_lib.sln index 3d3f49d2..b1025b6c 100644 --- a/build/msvc80/lib/soci_lib.sln +++ b/build/msvc80/lib/soci_lib.sln @@ -90,6 +90,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4C5CC316-8071-41B1-A159-BA98B18AF7EC}" ProjectSection(SolutionItems) = preProject maketest.mak = maketest.mak + ..\README.txt = ..\README.txt EndProjectSection EndProject Global diff --git a/build/msvc80/soci.vsprops b/build/msvc80/soci.vsprops index 2c4ad8ff..feec5be6 100644 --- a/build/msvc80/soci.vsprops +++ b/build/msvc80/soci.vsprops @@ -8,7 +8,8 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""$(SOCI_CORE_DIR)";"$(SOCI_CORE_DIR)\test"" + AdditionalIncludeDirectories=""$(SOCI_CORE_DIR)";"$(SOCI_CORE_DIR)\test";"$(BOOST_INCLUDE_DIR)"" + PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" DisableLanguageExtensions="false" WarningLevel="4" DebugInformationFormat="4" @@ -21,11 +22,11 @@ /> <UserMacro Name="FIREBIRD_INCLUDE_DIR" - Value="C:\Program Files\Firebird\Firebird_1_5\include" + Value="C:\Program Files\Firebird\Firebird_2_0\include" /> <UserMacro Name="FIREBIRD_LIB_DIR" - Value="C:\Program Files\Firebird\Firebird_1_5\lib" + Value="C:\Program Files\Firebird\Firebird_2_0\lib" /> <UserMacro Name="FIREBIRD_LIB" @@ -69,11 +70,11 @@ /> <UserMacro Name="POSTGRESQL_INCLUDE_DIR" - Value="C:\Program Files\PostgreSQL\8.1\include" + Value="C:\Program Files\PostgreSQL\8.2\include" /> <UserMacro Name="POSTGRESQL_LIB_DIR" - Value="C:\Program Files\PostgreSQL\8.1\lib\ms" + Value="C:\Program Files\PostgreSQL\8.2\lib\ms" /> <UserMacro Name="POSTGRESQL_LIB" @@ -81,16 +82,20 @@ /> <UserMacro Name="SQLITE3_INCLUDE_DIR" - Value="C:\lib\sqlite3" + Value="C:\usr\sqlite\include" /> <UserMacro Name="SQLITE3_LIB_DIR" - Value="C:\lib\sqlite3" + Value="C:\usr\sqlite\lib" /> <UserMacro Name="SQLITE3_LIB" Value="sqlite3.lib" /> + <UserMacro + Name="BOOST_INCLUDE_DIR" + Value="c:\usr\boost-1.33.1\include" + /> <UserMacro Name="SOCI_VERSION" Value="2.2.0" @@ -200,5 +205,4 @@ Name="SOCI_CORE_DIR" Value="$(SOCI_SRC_DIR)\core" /> - </VisualStudioPropertySheet> diff --git a/build/unix/build-core.tcl b/build/unix/build-core.tcl new file mode 100644 index 00000000..aba8d8ec --- /dev/null +++ b/build/unix/build-core.tcl @@ -0,0 +1,37 @@ +proc buildCore {} { + global CXXFLAGS + + puts "building static core" + + set cwd [pwd] + cd "../../src/core" + foreach cppFile [glob "*.cpp"] { + execute "g++ -c $cppFile $CXXFLAGS" + } + + execute "ar cr libsoci_core.a [glob *.o]" + cd $cwd + eval exec mkdir -p "lib" + execute "cp ../../src/core/libsoci_core.a lib" + eval exec mkdir -p "include" + execute "cp [glob ../../src/core/*.h] include" +} + +proc buildCoreSo {} { + global CXXFLAGS SHARED + + puts "building shared core" + + set cwd [pwd] + cd "../../src/core" + foreach cppFile [glob "*.cpp"] { + execute "g++ -c $cppFile $CXXFLAGS -fPIC" + } + + execute "g++ $SHARED -o libsoci_core.so [glob *.o]" + cd $cwd + eval exec mkdir -p "lib" + execute "cp ../../src/core/libsoci_core.so lib" + eval exec mkdir -p "include" + execute "cp [glob ../../src/core/*.h] include" +} diff --git a/build/unix/build-mysql.tcl b/build/unix/build-mysql.tcl new file mode 100644 index 00000000..f1371ae5 --- /dev/null +++ b/build/unix/build-mysql.tcl @@ -0,0 +1,142 @@ +source "local/parameters.tcl" + +proc findMySQL {} { + global mysqlInclude mysqlLib + + # candidate directories for local MySQL: + set includeDirs { + "/usr/local/include/mysql" + "/usr/include/mysql" + "/usr/local/include" + "/usr/include" + "/opt/local/include" + } + set libDirs { + "/usr/local/lib/mysql" + "/usr/lib/mysql" + "/usr/local/lib" + "/usr/lib" + "/opt/local/lib" + } + + if [info exists mysqlInclude] { + set includeDirs [list $mysqlInclude] + } + if [info exists mysqlLib] { + set libDirs [list $mysqlLib] + } + + set includeDir "" + foreach I $includeDirs { + set header "${I}/mysql.h" + if {[file exists $header]} { + set includeDir $I + break + } + } + if {$includeDir == ""} { + return {} + } + + set libDir "" + foreach L $libDirs { + set libraryA "${L}/libmysqlclient.a" + set librarySo "${L}/libmysqlclient.so" + if {[file exists $libraryA] || [file exists $librarySo]} { + set libDir $L + break + } + } + if {$libDir == ""} { + return {} + } + + return [list $includeDir $libDir] +} + +proc buildMySQL {} { + global CXXFLAGS + + puts "building static MySQL" + + set dirs [findMySQL] + if {$dirs == {}} { + puts "cannot find MySQL library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/mysql" + foreach cppFile [glob "*.cpp"] { + execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" + } + + execute "ar cr libsoci_mysql.a [glob *.o]" + cd $cwd + eval exec mkdir -p "lib" + execute "cp ../../src/backends/mysql/libsoci_mysql.a lib" + eval exec mkdir -p "include" + execute "cp ../../src/backends/mysql/soci-mysql.h include" +} + +proc buildMySQLSo {} { + global CXXFLAGS SHARED + + puts "building shared MySQL" + + set dirs [findMySQL] + if {$dirs == {}} { + puts "cannot find MySQL library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/mysql" + foreach cppFile [glob "*.cpp"] { + execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" + } + + execute "g++ $SHARED -o libsoci_mysql.so [glob *.o] -L${libDir} -lmysqlclient -lz" + cd $cwd + eval exec mkdir -p "lib" + execute "cp ../../src/backends/mysql/libsoci_mysql.so lib" + eval exec mkdir -p "include" + execute "cp ../../src/backends/mysql/soci-mysql.h include" +} + +proc buildMySQLTest {} { + global CXXTESTFLAGS LDL + + puts "building MySQL test" + + set dirs [findMySQL] + if {$dirs == {}} { + puts "cannot find MySQL library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set dirs [findBoost] + if {$dirs == {}} { + puts "cannot find Boost library files, skipping this target" + return + } + + set boostIncludeDir [lindex $dirs 0] + set boostLibDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/mysql/test" + execute "g++ test-mysql.cpp -o test-mysql $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_mysql -lboost_date_time ${LDL} -lmysqlclient -lz" + cd $cwd + eval exec mkdir -p "tests" + execute "cp ../../src/backends/mysql/test/test-mysql tests" +} diff --git a/build/unix/build-oracle.tcl b/build/unix/build-oracle.tcl new file mode 100644 index 00000000..ac59d0b2 --- /dev/null +++ b/build/unix/build-oracle.tcl @@ -0,0 +1,120 @@ +proc findOracle {} { + global env oracleInclude oracleLib + + if {[info exists oracleInclude] && + [info exists oracleLib]} { + set includeDir $oracleInclude + set libDir $oracleLib + } else { + if {[info exists env(ORACLE_HOME)] == 0} { + puts "The ORACLE_HOME variable is not set." + return {} + } + + set ORACLE_HOME $env(ORACLE_HOME) + + set includeDir [file join $ORACLE_HOME "rdbms/public"] + set header [file join $includeDir "oci.h"] + if {[file exists $header] == 0} { + puts "ORACLE_HOME is strange." + return {} + } + + set libDir [file join $ORACLE_HOME "lib"] + set libraryA [file join $libDir "libclntsh.a"] + set librarySo [file join $libDir "libclntsh.so"] + if {([file exists $libraryA] == 0) && ([file exists $librarySo] == 0)} { + puts "ORACLE_HOME is strange." + return {} + } + } + + return [list $includeDir $libDir] +} + +proc buildOracle {} { + global CXXFLAGS + + puts "building static Oracle" + + set dirs [findOracle] + if {$dirs == {}} { + puts "cannot find Oracle library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/oracle" + foreach cppFile [glob "*.cpp"] { + execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" + } + + execute "ar cr libsoci_oracle.a [glob *.o]" + cd $cwd + eval exec mkdir -p "lib" + execute "cp ../../src/backends/oracle/libsoci_oracle.a lib" + eval exec mkdir -p "include" + execute "cp ../../src/backends/oracle/soci-oracle.h include" +} + +proc buildOracleSo {} { + global CXXFLAGS SHARED + + puts "building shared Oracle" + + set dirs [findOracle] + if {$dirs == {}} { + puts "cannot find Oracle library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/oracle" + foreach cppFile [glob "*.cpp"] { + execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" + } + + execute "g++ $SHARED -o libsoci_oracle.so [glob *.o] -L${libDir} -lclntsh -lnnz10" + cd $cwd + eval exec mkdir -p "lib" + execute "cp ../../src/backends/oracle/libsoci_oracle.so lib" + eval exec mkdir -p "include" + execute "cp ../../src/backends/oracle/soci-oracle.h include" +} + +proc buildOracleTest {} { + global CXXTESTFLAGS LDL + + puts "building Oracle test" + + set dirs [findOracle] + if {$dirs == {}} { + puts "cannot find Oracle library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set dirs [findBoost] + if {$dirs == {}} { + puts "cannot find Boost library files, skipping this target" + return + } + + set boostIncludeDir [lindex $dirs 0] + set boostLibDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/oracle/test" + execute "g++ test-oracle.cpp -o test-oracle $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_oracle -lboost_date_time ${LDL} -lclntsh -lnnz10" + cd $cwd + eval exec mkdir -p "tests" + execute "cp ../../src/backends/oracle/test/test-oracle tests" +} diff --git a/build/unix/build-postgresql.tcl b/build/unix/build-postgresql.tcl new file mode 100644 index 00000000..49a4f939 --- /dev/null +++ b/build/unix/build-postgresql.tcl @@ -0,0 +1,148 @@ +proc findPostgreSQL {} { + global postgresqlInclude postgresqlLib + + # candidate directories for local PostgreSQL: + set includeDirs { + "/usr/local/pgsql/include" + "/usr/local/postgresql/include" + "/usr/local/include/pgsql" + "/usr/local/include/postgresql" + "/usr/include/pgsql" + "/usr/include/postgresql" + "/usr/local/include" + "/usr/include" + "/opt/local/include" + } + set libDirs { + "/usr/local/pgsql/lib" + "/usr/local/postgresql/lib" + "/usr/local/lib/pgsql" + "/usr/local/lib/postgresql" + "/usr/lib/pgsql" + "/usr/lib/postgresql" + "/usr/local/lib" + "/usr/lib" + "/opt/local/lib" + } + + if [info exists postgresqlInclude] { + set includeDirs [list $postgresqlInclude] + } + if [info exists postgresqlLib] { + set libDirs [list $postgresqlLib] + } + + set includeDir "" + foreach I $includeDirs { + set header "${I}/libpq/libpq-fs.h" + if {[file exists $header]} { + set includeDir $I + break + } + } + if {$includeDir == ""} { + return {} + } + + set libDir "" + foreach L $libDirs { + set libraryA "${L}/libpq.a" + set librarySo "${L}/libpq.so" + if {[file exists $libraryA] || [file exists $librarySo]} { + set libDir $L + break + } + } + if {$libDir == ""} { + return {} + } + + return [list $includeDir $libDir] +} + +proc buildPostgreSQL {} { + global CXXFLAGS + + puts "building static PostgreSQL" + + set dirs [findPostgreSQL] + if {$dirs == {}} { + puts "cannot find PostgreSQL library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/postgresql" + foreach cppFile [glob "*.cpp"] { + execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" + } + + execute "ar cr libsoci_postgresql.a [glob *.o]" + cd $cwd + eval exec mkdir -p "lib" + execute "cp ../../src/backends/postgresql/libsoci_postgresql.a lib" + eval exec mkdir -p "include" + execute "cp ../../src/backends/postgresql/soci-postgresql.h include" +} + +proc buildPostgreSQLSo {} { + global CXXFLAGS SHARED + + puts "building shared PostgreSQL" + + set dirs [findPostgreSQL] + if {$dirs == {}} { + puts "cannot find PostgreSQL library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/postgresql" + foreach cppFile [glob "*.cpp"] { + execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" + } + + execute "g++ $SHARED -o libsoci_postgresql.so [glob *.o] -L${libDir} -lpq" + cd $cwd + eval exec mkdir -p "lib" + execute "cp ../../src/backends/postgresql/libsoci_postgresql.so lib" + eval exec mkdir -p "include" + execute "cp ../../src/backends/postgresql/soci-postgresql.h include" +} + +proc buildPostgreSQLTest {} { + global CXXTESTFLAGS LDL + + puts "building PostgreSQL test" + + set dirs [findPostgreSQL] + if {$dirs == {}} { + puts "cannot find PostgreSQL library files, skipping this target" + return + } + + set includeDir [lindex $dirs 0] + set libDir [lindex $dirs 1] + + set dirs [findBoost] + if {$dirs == {}} { + puts "cannot find Boost library files, skipping this target" + return + } + + set boostIncludeDir [lindex $dirs 0] + set boostLibDir [lindex $dirs 1] + + set cwd [pwd] + cd "../../src/backends/postgresql/test" + execute "g++ test-postgresql.cpp -o test-postgresql $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_postgresql -lboost_date_time ${LDL} -lpq" + cd $cwd + eval exec mkdir -p "tests" + execute "cp ../../src/backends/postgresql/test/test-postgresql tests" +} diff --git a/build/unix/build.tcl b/build/unix/build.tcl new file mode 100644 index 00000000..e26d339b --- /dev/null +++ b/build/unix/build.tcl @@ -0,0 +1,82 @@ +#!/usr/bin/tclsh + +# some common compilation settings if you need to change them: + +set CXXFLAGS "-Wall -pedantic -Wno-long-long -O2" +set CXXTESTFLAGS "-O2" + +if {$tcl_platform(os) == "Darwin"} { + # special case for Mac OS X + set SHARED "-dynamiclib -flat_namespace -undefined suppress" +} else { + set SHARED "-shared" +} + +if {$tcl_platform(os) == "FreeBSD"} { + # FreeBSD does not have the libdl library, it is part of libc. + set LDL "" +} else { + set LDL "-ldl" +} + +source "execute.tcl" +source "find-boost.tcl" +source "build-core.tcl" +source "build-oracle.tcl" +source "build-postgresql.tcl" +source "build-mysql.tcl" + +proc printUsageAndExit {} { + puts "Usage:" + puts "$ ./build.tcl list-of-targets" + puts "" + puts "list of targets can contain any of:" + puts "core - the core part of the library (static version)" + puts "core-so - the core part of the library (shared version)" + puts "oracle - the static Oracle backend" + puts "oracle-so - the shared Oracle backend" + puts " Note: before building Oracle backend" + puts " set the ORACLE_HOME variable properly." + puts "postgresql - the static PostgreSQL backend" + puts "postgresql-so - the shared PostgreSQL backend" + puts "mysql - the static MySQL backend" + puts "mysql-so - the shared MySQL backend" + puts "" + puts "oracle-test - the test for Oracle" + puts "postgresql-test - the test for PostgreSQL" + puts "mysql-test - the test for MySQL" + puts " Note: build static core and backends first." + puts "" + puts "Examples:" + puts "" + puts "$ ./build.tcl core mysql" + puts "" + puts "$ ./build.tcl core postgresql postgresql-test" + puts "" + puts "After successful build the results are in include, lib and test directories." + puts "Move/copy the contents of these directories wherever you want." + exit +} + +if {$argc == 0 || $argv == "--help"} { + printUsageAndExit +} + +foreach target $argv { + switch -exact $target { + core buildCore + core-so buildCoreSo + oracle buildOracle + oracle-so buildOracleSo + oracle-test buildOracleTest + postgresql buildPostgreSQL + postgresql-so buildPostgreSQLSo + postgresql-test buildPostgreSQLTest + mysql buildMySQL + mysql-so buildMySQLSo + mysql-test buildMySQLTest + default { + puts "unknown target $target - skipping" + } + } +} diff --git a/build/unix/execute.tcl b/build/unix/execute.tcl new file mode 100644 index 00000000..90d57485 --- /dev/null +++ b/build/unix/execute.tcl @@ -0,0 +1,14 @@ +proc execute {command} { + puts $command + set result [catch {eval exec $command "2>@ stdout"} output] + if {$result != 0} { + puts "The last command did not execute properly:" + puts $output + puts "Please contact the SOCI team." + exit + } else { + if {$output != ""} { + puts $output + } + } +} diff --git a/build/unix/find-boost.tcl b/build/unix/find-boost.tcl new file mode 100644 index 00000000..c0785bf4 --- /dev/null +++ b/build/unix/find-boost.tcl @@ -0,0 +1,47 @@ +proc findBoost {} { + global rootBoost + + # candidate directories for local Boost: + set includeDirs { + "/usr/local/include" + "/usr/include" + "/opt/local/include" + } + set libDirs { + "/usr/local/lib" + "/usr/lib" + "/opt/local/lib" + } + + if [info exists rootBoost] { + set includeDirs [list $rootBoost] + set libDirs [list + } + + set includeDir "" + foreach I $includeDirs { + set header "${I}/boost/version.hpp" + if {[file exists $header]} { + set includeDir $I + break + } + } + if {$includeDir == ""} { + return {} + } + + set libDir "" + foreach L $libDirs { + set libraryA "${L}/libboost_date_time.a" + set librarySo "${L}/libboost_date_time.so" + if {[file exists $libraryA] || [file exists $librarySo]} { + set libDir $L + break + } + } + if {$libDir == ""} { + return {} + } + + return [list $includeDir $libDir] +} diff --git a/build/unix/install.tcl b/build/unix/install.tcl new file mode 100644 index 00000000..1787593a --- /dev/null +++ b/build/unix/install.tcl @@ -0,0 +1,68 @@ +set headerInstallPrefix "/usr/local/include/soci" +set libInstallPrefix "/usr/local/lib" +set sociVersion "3.0.0" +set sociMajor "3" + +source "execute.tcl" +source "local/parameters.tcl" + +set uninstallFile [open "local/uninstall.sh" "w"] + +if {[file exists $headerInstallPrefix] == 0} { + execute "mkdir -p $headerInstallPrefix" + puts $uninstallFile "rm -rf $headerInstallPrefix" +} + +foreach header [glob "include/*"] { + set tail [file tail $header] + puts "copying $tail to ${headerInstallPrefix}" + execute "cp $header $headerInstallPrefix" + puts $uninstallFile "rm -f ${headerInstallPrefix}/${tail}" +} + +if {[file exists $libInstallPrefix] == 0} { + execute "mkdir -p $libInstallPrefix" + puts $uninstallFile "rm -rf $libInstallPrefix" +} + +foreach lib [glob "lib/*.a"] { + set tail [file tail $lib] + puts "copying $tail to ${libInstallPrefix}" + execute "cp $lib $libInstallPrefix" + puts $uninstallFile "rm -f ${libInstallPrefix}/${tail}" +} + +set buildDir [pwd] +cd $libInstallPrefix +foreach lib [glob "${buildDir}/lib/*.so"] { + set rootName [file rootname [file tail $lib]] + set targetName "${rootName}-${sociVersion}.so" + set majorLink "${rootName}-${sociMajor}.so" + set link "${rootName}.so" + + puts "copying [file tail $lib] to ${targetName}" + execute "cp $lib $targetName" + puts $uninstallFile "rm -f ${libInstallPrefix}/${targetName}" + + puts "creating link ${majorLink}" + execute "ln -s $targetName [file tail $majorLink]" + puts $uninstallFile "rm -f ${libInstallPrefix}/${majorLink}" + + puts "creating ${link}" + execute "ln -s $targetName [file tail $link]" + puts $uninstallFile "rm -f ${libInstallPrefix}/${link}" +} + +close $uninstallFile + +puts "ldconfig ${libInstallPrefix}" +catch { eval exec "ldconfig ${libInstallPrefix}" } + +puts "" +puts "" +puts "Hint: the shared libraries were installed in $libInstallPrefix" +puts "- If you use dynamically loaded backends, then you might need to set" +puts " the SOCI_BACKENDS_PATH variable accordingly." +puts "" +puts "Hint: to remove all installed files and links run make uninstall" +puts "" diff --git a/build/unix/parse-parameters.tcl b/build/unix/parse-parameters.tcl new file mode 100644 index 00000000..574a6f60 --- /dev/null +++ b/build/unix/parse-parameters.tcl @@ -0,0 +1,60 @@ +set paramsFile [open "local/parameters"] +set tclParamsFile [open "local/parameters.tcl" "w"] + +set line [gets $paramsFile] +while {![eof $paramsFile]} { + set pair [split $line "="] + if {[llength $pair] == 2} { + set name [lindex $pair 0] + set value [lindex $pair 1] + + switch -exact -- $name { + --include-prefix { + puts $tclParamsFile "set headerInstallPrefix $value" + puts "setting prefix for SOCI headers to $value" + } + --lib-prefix { + puts $tclParamsFile "set libInstallPrefix $value" + puts "setting prefix for SOCI libraries to $value" + } + --mysql-include { + puts $tclParamsFile "set mysqlInclude $value" + puts "setting include directory for MySQL to $value" + } + --mysql-lib { + puts $tclParamsFile "set mysqlLib $value" + puts "setting lib directory for MySQL to $value" + } + --oracle-include { + puts $tclParamsFile "set oracleInclude $value" + puts "setting include directory for Oracle to $value" + } + --oracle-lib { + puts $tclParamsFile "set oracleLib $value" + puts "setting lib directory for Oracle to $value" + } + --postgresql-include { + puts $tclParamsFile "set postgresqlInclude $value" + puts "setting include directory for PostgreSQL to $value" + } + --postgresql-lib { + puts $tclParamsFile "set postgresqlLib $value" + puts "setting lib directory for PostgreSQL to $value" + } + --boost-include { + puts $tclParamsFile "set boostInclude $value" + puts "setting Boost include directory to $value" + } + --boost-lib { + puts $tclParamsFile "set boostLib $value" + puts "setting Boost lib directory to $value" + } + default { + puts "unknown option: $name : skipping it!" + } + } + } + set line [gets $paramsFile] +} +close $paramsFile +close $tclParamsFile diff --git a/config.guess b/config.guess deleted file mode 100644 index ad5281e6..00000000 --- a/config.guess +++ /dev/null @@ -1,1466 +0,0 @@ -#! /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 Free Software Foundation, Inc. - -timestamp='2005-08-03' - -# 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 <per@bothner.com>. -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted 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. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -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 <config-patches@gnu.org>." - -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 -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 -q "$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 ;; - *) 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 __ELF__ >/dev/null - 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 ;; - macppc:MirBSD:*:*) - echo powerppc-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 ;; - 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:SunOS:5.*:*) - echo i386-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 <stdio.h> /* 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 <sys/systemcfg.h> - - 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:*:[45]) - 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 <stdlib.h> - #include <unistd.h> - - 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 __LP64__ >/dev/null - 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 <unistd.h> - 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:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - i*: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 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-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 ;; - arm*: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 ;; - 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:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #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; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #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 ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - 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 ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-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 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*) - 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' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/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 i386. - echo i386-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; } ;; - 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.0*:*) - 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 <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # 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 ;; - 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 ;; - 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 - *86) UNAME_PROCESSOR=i686 ;; - 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 ;; -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 <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#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 <sys/param.h> - 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 <sys/param.h> -# 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 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess -and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> 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: diff --git a/config.sub b/config.sub deleted file mode 100644 index 1c366dfd..00000000 --- a/config.sub +++ /dev/null @@ -1,1579 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -timestamp='2005-07-08' - -# 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 <config-patches@gnu.org>. Submit a context -# diff and a properly formatted 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. - -# 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 <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -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-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-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) - os= - basic_machine=$1 - ;; - -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 - ;; - -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/'` - ;; - -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 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | ms1 \ - | msp430 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m32c) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # 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-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | ms1-* \ - | msp430-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - m32c-*) - ;; - # 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 - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - 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 - ;; - cr16c) - basic_machine=cr16c-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 - ;; - 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 - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - 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 - ;; - 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 - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - 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 - ;; - 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 - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - 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 - ;; - 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 - ;; - 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[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) - 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. - -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* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ - | -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* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -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*) - # 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 - ;; - -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 - *-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 - ;; - 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 - ;; - -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: diff --git a/configure b/configure index 3f16acfe..634724de 100644 --- a/configure +++ b/configure @@ -1,21885 +1,72 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for SOCI 2.2.0. -# -# Report bugs to <http://sourceforge.net/projects/soci>. -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +#!/bin/sh -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -echo=${ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit 0 -fi - -# 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 - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null +if [ $# -gt 0 ] +then + if [ $1 = "-help" -o $1 = "--help" ] then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -tagnames=${tagnames+${tagnames},}CXX - -tagnames=${tagnames+${tagnames},}F77 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME='SOCI' -PACKAGE_TARNAME='soci' -PACKAGE_VERSION='2.2.0' -PACKAGE_STRING='SOCI 2.2.0' -PACKAGE_BUGREPORT='http://sourceforge.net/projects/soci' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include <stdio.h> -#if HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#if HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#if STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# if HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#endif -#if HAVE_STRINGS_H -# include <strings.h> -#endif -#if HAVE_INTTYPES_H -# include <inttypes.h> -#else -# if HAVE_STDINT_H -# include <stdint.h> -# endif -#endif -#if HAVE_UNISTD_H -# include <unistd.h> -#endif" - -ac_default_prefix=/usr/local -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS RELEASE_MAJOR RELEASE_MINOR RELEASE_MICRO RELEASE_VERSION LIBTOOL_RELEASE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP F77 FFLAGS ac_ct_F77 LIBTOOL SOCI_CORE_LIBRARY_NAME SOCI_EMPTY_LIBRARY_NAME SOCI_FIREBIRD_LIBRARY_NAME SOCI_MYSQL_LIBRARY_NAME SOCI_ORACLE_LIBRARY_NAME SOCI_ODBC_LIBRARY_NAME SOCI_POSTGRESQL_LIBRARY_NAME SOCI_SQLITE3_LIBRARY_NAME EMPTY_DIRS FIREBIRD_CFLAGS FIREBIRD_LDFLAGS FIREBIRD_VERSION FIREBIRD_DIRS MYSQL_CONFIG MYSQL_VERSION MYSQL_CFLAGS MYSQL_LDFLAGS MYSQL_DIRS ODBC_DIRS ORACLE_OCI_VERSION ORACLE_OCI_CFLAGS ORACLE_OCI_LDFLAGS ORACLE_DIRS PG_CONFIG POSTGRESQL_VERSION POSTGRESQL_CFLAGS POSTGRESQL_LDFLAGS POSTGRESQL_DIRS SQLITE3_CFLAGS SQLITE3_LDFLAGS SQLITE3_VERSION SQLITE3_DIRS ac_aux_dir LIBOBJS LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_env_CXXFLAGS_value=$CXXFLAGS -ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_cv_env_CXXFLAGS_value=$CXXFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CXXCPP_set=${CXXCPP+set} -ac_env_CXXCPP_value=$CXXCPP -ac_cv_env_CXXCPP_set=${CXXCPP+set} -ac_cv_env_CXXCPP_value=$CXXCPP -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_F77_set=${F77+set} -ac_env_F77_value=$F77 -ac_cv_env_F77_set=${F77+set} -ac_cv_env_F77_value=$F77 -ac_env_FFLAGS_set=${FFLAGS+set} -ac_env_FFLAGS_value=$FFLAGS -ac_cv_env_FFLAGS_set=${FFLAGS+set} -ac_cv_env_FFLAGS_value=$FFLAGS - -# -# 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 SOCI 2.2.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -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 SOCI 2.2.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared[=PKGS] - build shared libraries [default=yes] - --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-debug=[yes|no] - enable debug build [default=no] - --enable-backend-firebird=[yes|no] - build-in Firebird backend support [default=no] - --enable-backend-mysql=[yes|no] - build-in MySQL backend support [default=no] - --enable-backend-oracle=[yes|no] - build-in ORACLE backend support [default=no] - --enable-backend-postgresql=[yes|no] - build-in PostgreSQL backend support - [default=no] - --enable-backend-sqlite3=[yes|no] - build-in SQLite 3 backend support [default=no] - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-tags[=TAGS] - include additional configurations [automatic] - --with-firebird=[ARG] - use Firebird client library [default=yes], - optionally specify the prefix for firebird library - --with-mysql=[ARG] - use MySQL client library [default=yes], - optionally specify path to mysql_config - --with-oracle=[DIR] - use Oracle OCI API from given path to Oracle home - directory - --with-oracle-include=[DIR] - use Oracle OCI API headers from given path - --with-oracle-lib=[DIR] - use Oracle OCI API libraries from given path - --with-postgresql=[ARG] - use PostgreSQL library [default=yes], - optionally specify path to pg_config - --with-sqlite3=[ARG] - use SQLite 3 library [default=yes], optionally - specify the prefix for sqlite3 library - -Some influential environment variables: - CXX C++ compiler command - CXXFLAGS C++ compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have - headers in a nonstandard directory <include dir> - CXXCPP C++ preprocessor - CC C compiler command - CFLAGS C compiler flags - CPP C preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags - -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 <http://sourceforge.net/projects/soci>. -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd "$ac_popdir" - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF -SOCI configure 2.2.0 -generated by GNU Autoconf 2.59 - -Copyright (C) 2003 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by SOCI $as_me 2.2.0, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo + echo 'Recognized configure options:' + echo '' + echo 'Installation options:' + echo '--include-prefix=/some/path - path to install SOCI header files' + echo '--lib-prefix=/some/path - path to install SOCI libraries' + echo '' + echo 'MySQL options:' + echo '--mysql-include=/some/path - directory containing mysql.h' + echo '--mysql-lib=/some/path - directory containing libmysqlclient.[a|so]' + echo '' + echo 'Oracle options (if ORACLE_HOME variable is not set):' + echo '--oracle-include=/some/path - directory containing oci.h' + echo '--oracle-lib=/some/path - directory containing libclntsh.[a|so]' + echo '' + echo 'PostgreSQL options:' + echo '--postgresql-include=/some/path - directory containing libpq/libpq-fs.h' + echo '--postgresql-lib=/some/path - directory containing libpq.[a|so]' + echo '' + echo 'Test programs compilation options (not needed for library build):' + echo '--boost-include=/some/path - root include directory of Boost' + echo '--boost-lib=/some/path - root lib directory of Boost' + echo '' + exit + fi +fi + +mkdir -p build/unix/local +path="build/unix/local/parameters" +rm -f $path +touch $path +for param in $* +do + echo $param >> $path +done + +printf 'Trying to find the Tcl interpreter... ' +tcl_found=0 + +for path in "/usr/bin/tclsh" \ + "/usr/local/bin/tclsh8.5" \ + "/usr/local/bin/tclsh8.4" \ + "/usr/local/bin/tclsh8.3"; do + if [ -x $path ] + then + echo $path > build/unix/local/tcl + echo $path + tcl_found=1 + break fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi done -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } +if [ $tcl_found -eq 0 ] +then + echo 'NOT found.' + echo 'Is the Tcl installed?' + exit 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -RELEASE_MAJOR=2 -RELEASE_MINOR=2 -RELEASE_MICRO=0 -RELEASE_VERSION=2.2.0 - - - - - - -LIBTOOL_RELEASE="2.2.0" - - -SOCI_LIBRARY_VERSION="${RELEASE_MAJOR}_${RELEASE_MINOR}" - - - - -am__api_version="1.9" -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$AWK" && break -done - -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -all: - @echo 'ac_maketemp="$(MAKE)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='soci' - VERSION='2.2.0' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -install_sh=${install_sh-"$am_aux_dir/install-sh"} - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STRIP=$ac_ct_STRIP -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - - - -if test -z ${CXXFLAGS}; then - CXXFLAGS="" -fi - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CXX" && break -done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - - CXX=$ac_ct_CXX -fi - - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 - (eval $ac_compiler --version </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 - (eval $ac_compiler -v </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 - (eval $ac_compiler -V </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 -echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C++ compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 -echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C++ compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cxx_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include <stdlib.h> -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - - ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 -rm -f confinc confmf - -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" - -fi; -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - - -if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - - -depcc="$CXX" am_compiler_list= - -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - - -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$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 <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - - - echo "$as_me:$LINENO: checking the C++ compiler vendor" >&5 -echo $ECHO_N "checking the C++ compiler vendor... $ECHO_C" >&6 -if test "${ac_cxx_toolset_vendor+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - cat >conftest.$ac_ext <<_ACEOF -#ifndef __GNUG__ - #error "Compiler definition macro __GNUG__ is undefined!" - #endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - ac_cxx_toolset_vendor="Free Software Foundation" - ac_cxx_toolset_fullname="GNU C/C++ Compiler" - ac_cxx_toolset_name="gcc" - ac_cxx_toolset_cmd="g++" - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - - cat >conftest.$ac_ext <<_ACEOF - - #ifndef _MSC_VER - #error "Compiler definition macro _MSC_VER is undefined!" - #endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - cat >conftest.$ac_ext <<_ACEOF -#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4 - #error "Macro test _MSC_VER < 1300 is false, it is not VC++ 6.0!" - #endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - ac_cxx_msvc_toolset=vc60 - - ac_cxx_toolset_vendor="Microsoft" - ac_cxx_toolset_fullname="Visual C++" - ac_cxx_toolset_name=$ac_cxx_msvc_toolset - ac_cxx_toolset_cmd="cl" - - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - cat >conftest.$ac_ext <<_ACEOF -#if _MSC_VER <= 1300 // 1300 == VC++ 7.0 - #error "Macro test _MSC_VER <= 1300 is false, it is not VC++ 7.0!" - #endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - ac_cxx_msvc_toolset=vc70 - - ac_cxx_toolset_vendor="Microsoft" - ac_cxx_toolset_fullname="Visual C++" - ac_cxx_toolset_name=$ac_cxx_msvc_toolset - ac_cxx_toolset_cmd="cl" - - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - cat >conftest.$ac_ext <<_ACEOF -#if _MSC_VER <= 1300 // 1300 == VC++ 7.0 - #error "Macro test _MSC_VER <= 1300 is false, it is not VC++ 7.0!" - #endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - ac_cxx_msvc_toolset=vc70 - - ac_cxx_toolset_vendor="Microsoft" - ac_cxx_toolset_fullname="Visual C++" - ac_cxx_toolset_name=$ac_cxx_msvc_toolset - ac_cxx_toolset_cmd="cl" - - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - cat >conftest.$ac_ext <<_ACEOF -#if _MSC_VER < 1310 // 1310 == VC++ 7.1 - #error "Macro test _MSC_VER < 1310 is false, it is not VC++ 7.1!" - #endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - ac_cxx_msvc_toolset=vc71 - - ac_cxx_toolset_vendor="Microsoft" - ac_cxx_toolset_fullname="Visual C++" - ac_cxx_toolset_name=$ac_cxx_msvc_toolset - ac_cxx_toolset_cmd="cl" - - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - cat >conftest.$ac_ext <<_ACEOF -#if _MSC_VER <= 1400 // 1400 == VC++ 8.0 - #error "Macro test _MSC_VER < 1400 is false, it is not VC++ 8.0!" - #endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - ac_cxx_msvc_toolset=vc80 - - ac_cxx_toolset_vendor="Microsoft" - ac_cxx_toolset_fullname="Visual C++" - ac_cxx_toolset_name=$ac_cxx_msvc_toolset - ac_cxx_toolset_cmd="cl" - - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - ac_cxx_toolset_vendor=unknown - ac_cxx_toolset_fullname=unknown - ac_cxx_toolset_name=unknown - ac_cxx_toolset_cmd=unknown - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - ac_cxx_toolset_vendor=unknown - ac_cxx_toolset_fullname=unknown - ac_cxx_toolset_name=unknown - ac_cxx_toolset_cmd=unknown - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -fi -echo "$as_me:$LINENO: result: $ac_cxx_toolset_vendor" >&5 -echo "${ECHO_T}$ac_cxx_toolset_vendor" >&6 - - CXX_TOOLSET_VENDOR=$ac_cxx_toolset_vendor - CXX_TOOLSET_FULLNAME=$ac_cxx_toolset_fullname - CXX_TOOLSET_NAME=$ac_cxx_toolset_name - CXX_TOOLSET_COMMAND=$ac_cxx_toolset_cmd - - - -SOCI_LIBRARY_TOOLSET="$CXX_TOOLSET_NAME" - - -# Check whether --enable-shared or --disable-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=yes -fi; - -# Check whether --enable-static or --disable-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 --enable-fast-install or --disable-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; - -# Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 -build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 -host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 - (eval $ac_compiler --version </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 - (eval $ac_compiler -v </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 - (eval $ac_compiler -V </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include <stdlib.h> -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -depcc="$CC" am_compiler_list= - -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - - -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - -echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # 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 -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 $lt_ac_count -gt 10 && 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 - -fi - -SED=$lt_cv_path_SED -echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 </dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break - ;; - *) - test "$with_gnu_ld" != yes && break - ;; - esac - fi - done - IFS="$lt_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$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 - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - 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 - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi -echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6 -NM="$lt_cv_path_NM" - -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -# which 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 -aix4* | aix5*) - 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'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | kfreebsd*-gnu | 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 - ;; - -gnu*) - 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]) 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 - ;; - -interix3*) - # 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 Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu | knetbsd*-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=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 - ;; - -solaris*) - 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 - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -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 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 whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" != xno && 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 which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - 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 which ABI we are using. - echo '#line 4773 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; 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* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|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-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - 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" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -lt_cv_cc_needs_belf=no -fi -rm -f 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 -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - - -esac - -need_locks="$enable_libtool_lock" - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ctype.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------------------------- ## -## Report this to http://sourceforge.net/projects/soci ## -## --------------------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$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 <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -fi - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_F77" && break -done - - F77=$ac_ct_F77 -fi - - -# Provide some information about the compiler. -echo "$as_me:5903:" \ - "checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 - (eval $ac_compiler --version </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 - (eval $ac_compiler -v </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 - (eval $ac_compiler -V </dev/null >&5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_f77_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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*) - # 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; - ;; - - 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; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # 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 - ;; - - 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 - ;; - *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - 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` - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -fi - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - 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 - -# 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 - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Try without a prefix undercore, 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -EOF - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 <<EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <<EOF >> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_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 -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; 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 - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 -else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 -fi - -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6 -objdir=$lt_cv_objdir - - - - - -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 "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -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 avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - AR=$ac_ct_AR -else - AR="$ac_cv_prog_AR" -fi - -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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STRIP=$ac_ct_STRIP -else - STRIP="$ac_cv_prog_STRIP" -fi - - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <<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 - -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 - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <<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 - -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 - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -enable_dlopen=no -enable_win32_dll=no - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -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;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - - -# 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 -printf "$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 -printf "$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 conftest* - - - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - - -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # 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:6964: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:6968: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; 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= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - # 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' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - interix3*) - # 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 - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - hpux*) - # 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='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - 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 "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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' - ;; - - 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' - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # 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' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - 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 - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # 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:7232: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:7236: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 - -if test x"$lt_prog_compiler_pic_works" = xyes; 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 -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 - -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:7336: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:7340: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # 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_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = yes; 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 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - 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 - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach <jrb3@best.com> 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*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - 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/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - 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 (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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 - ;; - - interix3*) - 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' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - 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; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # 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; $echo \"$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' ;; - esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs=no - else - ld_shlibs=no - fi - ;; - - netbsd* | netbsdelf*-gnu | knetbsd*-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 $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' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - 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 - ;; - - 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 can not -*** 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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$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 $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 - - if test "$ld_shlibs" = no; 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 "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU 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")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | 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 - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - 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_libdir_separator=':' - link_all_deplibs=yes - - if test "$GCC" = yes; 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 - hardcode_direct=yes - 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 "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # 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_use_runtimelinking" = yes; 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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; 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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - 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 - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - 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 `echo "$deplibs" | $SED -e '\''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' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=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 -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # GNU/kFreeBSD uses gcc -shared to do shared libraries. - kfreebsd*-gnu) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - link_all_deplibs=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $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 $output_objdir/$soname = $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 "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${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 "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - hardcode_direct=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 "$GCC" = yes -a "$with_gnu_ld" = no; 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 ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${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' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=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 "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd* | netbsdelf*-gnu | knetbsd*-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 - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - 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' - 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 linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; 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*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; 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 can NOT 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='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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 - fi - -echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6 -test "$ld_shlibs" = no && can_build_shared=no - -# -# 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 "$enable_shared" = yes && test "$GCC" = yes; 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. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 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:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; 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 - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.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}' - else - # 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' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-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='GNU ld.so' - ;; - -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[123]*) 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} $libname${shared_ext}' - 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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 "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - 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' - ;; - -interix3*) - 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' - 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 "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - 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 - ;; - -# This must be Linux ELF. -linux*) - 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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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 - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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' - ;; - -knetbsd*-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='GNU ld.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 - 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=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=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - 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 - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -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" - ;; - -solaris*) - 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=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 "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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=freebsd-elf - 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 - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var" || \ - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; 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 -echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}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" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -if test "x$enable_dlopen" != xyes; 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*) - 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 - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; 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 - - ;; - - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef shl_load - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* 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_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef dlopen - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* 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_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && 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" - - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; 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 <<EOF -#line 9694 "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; 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 <<EOF -#line 9794 "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$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 - - -# Report which library types will actually be built -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - - cat <<__EOF__ >> "$cfgfile" -#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 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. - -# 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//" - -# 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 - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# 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 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# 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 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# 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 and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -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 - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - -# 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 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 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# 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 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_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 - -# ### END LIBTOOL CONFIG - -__EOF__ - - - case $host_os in - aix3*) - cat <<\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 "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # 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" - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -CC="$lt_save_CC" - - -# Check whether --with-tags or --without-tags was given. -if test "${with_tags+set}" = set; then - withval="$with_tags" - tagnames="$withval" -fi; - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# 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= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# 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 -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -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++"} -compiler=$CC -compiler_CXX=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 </dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break - ;; - *) - test "$with_gnu_ld" != yes && break - ;; - esac - fi - done - IFS="$lt_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$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 "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -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 "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; 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 - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - 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_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes; 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 - hardcode_direct_CXX=yes - 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 "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # 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_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; 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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach <jrb3@best.com> 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*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - 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 (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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 - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - 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' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; - - 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 - ;; - freebsd[12]*) - # 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* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - 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 $output_objdir/$soname = $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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; - *) - 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_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; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; 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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${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 - ;; - interix3*) - 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" && echo -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 "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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=: - ;; - linux*) - 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; echo $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*) - # 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*) - # Portland Group C++ compiler - 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' - - 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; $echo \"$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=`echo $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; echo $list' - ;; - 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* | netbsdelf*-gnu | knetbsd*-gnu) - 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::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - 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__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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='echo' - ;; - osf3*) - 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 - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - 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" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - 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. - # - # 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=`echo $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; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - 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 "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - 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. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - 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" && echo -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' - 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=`echo $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; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - 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 "\-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*) - # 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 C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - output_verbose_link_cmd='echo' - - # 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 "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $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 -nostdlib ${wl}-M $wl$lib.exp -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 \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $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 -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 \"\-L\"" - fi - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - 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 can NOT 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. - # 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. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - 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='`test -z "$SCOABSPATH" && echo ${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,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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 -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no - -GCC_CXX="$GXX" -LD_CXX="$LD" - - -cat > conftest.$ac_ext <<EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -EOF - -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # 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 - - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` - - for p in `eval $output_verbose_link_cmd`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p 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 - ;; - - *.$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 "$pre_test_object_deps_done" = no; 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 - -# PORTME: override above test on systems where it is broken -case $host_os in -interix3*) - # 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= - ;; - -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' - ;; - esac - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; 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 "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - amigaos*) - # 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' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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' - ;; - 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= - ;; - interix3*) - # 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 IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; 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_AC_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 - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - 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* | kfreebsd*-gnu | 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 "$host_cpu" != ia64; 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*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # 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' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - ;; - 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*) - # 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 - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - 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 - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # 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:12132: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:12136: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; 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 -case $host_os in - # For platforms which 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 - -# -# 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\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_CXX=yes - fi - else - lt_prog_compiler_static_works_CXX=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 - -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi - - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:12236: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:12240: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU 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")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - kfreebsd*-gnu) - link_all_deplibs_CXX=no - ;; - linux*) - link_all_deplibs_CXX=no - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no - -# -# 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 "$enable_shared" = yes && test "$GCC" = yes; 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. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 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:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - 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* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; 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 - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.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}' - else - # 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' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-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='GNU ld.so' - ;; - -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[123]*) 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} $libname${shared_ext}' - 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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 "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - 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' - ;; - -interix3*) - 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' - 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 "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - 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 - ;; - -# This must be Linux ELF. -linux*) - 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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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 - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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' - ;; - -knetbsd*-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='GNU ld.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 - 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=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=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - 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 - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -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" - ;; - -solaris*) - 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=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 "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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=freebsd-elf - 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 - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var_CXX" || \ - test "X$hardcode_automatic_CXX" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != no && - # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; 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 -echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6 - -if test "$hardcode_action_CXX" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# 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 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_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 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# 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 and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_CXX - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -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 - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_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 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 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_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 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# 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 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -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 - - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# 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 -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 - -GCC_F77="$G77" -LD_F77="$LD" - -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - amigaos*) - # 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_F77='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; - - interix3*) - # 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_F77=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - - hpux*) - # 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_F77='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-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_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # 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:13824: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:13828: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 - -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_F77=yes - fi - else - lt_prog_compiler_static_works_F77=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 - -if test x"$lt_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi - - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:13928: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:13932: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_F77=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 .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # 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_F77="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs_F77=yes - if test "$with_gnu_ld" = yes; 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_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$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 (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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_F77=no - fi - ;; - - interix3*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${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_F77='$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_F77='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' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs_F77=no - else - ld_shlibs_F77=no - fi - ;; - - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $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_F77=no - cat <<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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** 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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$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_F77=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_F77=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | 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 - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - 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_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - - if test "$GCC" = yes; 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 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=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_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # 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_F77=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$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. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # GNU/kFreeBSD uses gcc -shared to do shared libraries. - kfreebsd*-gnu) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - link_all_deplibs_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; - - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; - - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$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' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_F77=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT 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_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - *) - ld_shlibs_F77=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6 -test "$ld_shlibs_F77" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 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. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; 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 - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.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}' - else - # 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' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-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='GNU ld.so' - ;; - -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[123]*) 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} $libname${shared_ext}' - 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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 "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - 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' - ;; - -interix3*) - 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' - 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 "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - 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 - ;; - -# This must be Linux ELF. -linux*) - 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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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 - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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' - ;; - -knetbsd*-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='GNU ld.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 - 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=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=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - 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 - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -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" - ;; - -solaris*) - 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=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 "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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=freebsd-elf - 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 - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != no && - # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6 - -if test "$hardcode_action_F77" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_F77 - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_F77 - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_F77 - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_F77 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# 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_F77 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' - -# 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 -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no - -old_archive_cmds_GCJ=$old_archive_cmds - - -lt_prog_compiler_no_builtin_flag_GCJ= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' - - -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # 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:16151: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:16155: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - amigaos*) - # 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_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_GCJ='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' - ;; - - interix3*) - # 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_GCJ=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic - fi - ;; - - hpux*) - # 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_GCJ='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_GCJ='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-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_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; - - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # 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:16419: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:16423: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 - -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= - ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_GCJ=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_GCJ=yes - fi - else - lt_prog_compiler_static_works_GCJ=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 - -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then - : -else - lt_prog_compiler_static_GCJ= -fi - - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:16523: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:16527: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_GCJ=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 .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # 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_GCJ="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = yes; 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_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$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 (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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_GCJ=no - fi - ;; - - interix3*) - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${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_GCJ='$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_GCJ='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' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs_GCJ=no - else - ld_shlibs_GCJ=no - fi - ;; - - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $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_GCJ=no - cat <<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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_GCJ=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** 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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$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_GCJ=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_GCJ=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | 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 - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - 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_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - - if test "$GCC" = yes; 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 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=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_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # 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_GCJ=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ='$convenience' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - freebsd1*) - ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # GNU/kFreeBSD uses gcc -shared to do shared libraries. - kfreebsd*-gnu) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - link_all_deplibs_GCJ=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${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_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - *) - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; - - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; - - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$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' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_GCJ=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z,text' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT 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_GCJ='${wl}-z,text' - allow_undefined_flag_GCJ='${wl}-z,nodefs' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - *) - ld_shlibs_GCJ=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6 -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ 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. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - pic_flag=$lt_prog_compiler_pic_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; 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 - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.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}' - else - # 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' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-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='GNU ld.so' - ;; - -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[123]*) 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} $libname${shared_ext}' - 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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 "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - 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' - ;; - -interix3*) - 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' - 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 "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - 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 - ;; - -# This must be Linux ELF. -linux*) - 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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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 - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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' - ;; - -knetbsd*-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='GNU ld.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 - 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=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=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - 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 - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -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" - ;; - -solaris*) - 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=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 "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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=freebsd-elf - 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 - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != no && - # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6 - -if test "$hardcode_action_GCJ" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_GCJ - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_GCJ - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_GCJ - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_GCJ - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# 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_GCJ - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - RC) - - - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# 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. - -# 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 -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - -lt_cv_prog_compiler_c_o_RC=yes - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_RC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_RC - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_RC - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_RC - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# 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_RC - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -CC="$lt_save_CC" - - ;; - - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi -fi - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - - - - - - - - - - - - - - - - - - - - - - -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -all: - @echo 'ac_maketemp="$(MAKE)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - - - - - -CXXFLAGS="${CXXFLAGS} -Wall -pedantic -Wno-long-long" - - -# Check whether --enable-debug or --disable-debug was given. -if test "${enable_debug+set}" = set; then - enableval="$enable_debug" - - case "${enableval}" in - yes) SOCI_BUILD_DEBUG="yes" ;; - no) SOCI_BUILD_DEBUG="no" ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug" >&5 -echo "$as_me: error: bad value ${enableval} for --enable-debug" >&2;} - { (exit 1); exit 1; }; };; - esac - -else - SOCI_BUILD_DEBUG="no" -fi; - -if test "$SOCI_BUILD_DEBUG" = "yes"; then - SOCI_LIBRARY_RUNTIME="g" - CXXFLAGS="-g ${CXXFLAGS}" - CPPFLAGS="-D_DEBUG -UNDEBUG ${CPPFLAGS}" -else - SOCI_LIBRARY_RUNTIME="" - CXXFLAGS="${CXXFLAGS}" - CPPFLAGS="-DNDEBUG -U_DEBUG ${CPPFLAGS}" -fi - - - -SOCI_LIBRARY_PREFIX="soci" - -if test -z "${SOCI_LIBRARY_RUNTIME}"; then - SOCI_LIBRARY_SUFFIX="${SOCI_LIBRARY_TOOLSET}-${SOCI_LIBRARY_VERSION}" -else - SOCI_LIBRARY_SUFFIX="${SOCI_LIBRARY_TOOLSET}-${SOCI_LIBRARY_RUNTIME}-${SOCI_LIBRARY_VERSION}" -fi - -SOCI_CORE_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_core-${SOCI_LIBRARY_SUFFIX}" -SOCI_EMPTY_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_empty-${SOCI_LIBRARY_SUFFIX}" -SOCI_FIREBIRD_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_firebird-${SOCI_LIBRARY_SUFFIX}" -SOCI_MYSQL_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_mysql-${SOCI_LIBRARY_SUFFIX}" -SOCI_ORACLE_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_oracle-${SOCI_LIBRARY_SUFFIX}" -SOCI_ODBC_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_odbc-${SOCI_LIBRARY_SUFFIX}" -SOCI_POSTGRESQL_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_postgresql-${SOCI_LIBRARY_SUFFIX}" -SOCI_SQLITE3_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_sqlite3-${SOCI_LIBRARY_SUFFIX}" - - - - - - - - - - - -WANT_BACKEND_EMPTY="yes" -EMPTY_DIRS="empty empty/test" - - - -# Check whether --enable-backend-firebird or --disable-backend-firebird was given. -if test "${enable_backend_firebird+set}" = set; then - enableval="$enable_backend_firebird" - WANT_BACKEND_FIREBIRD=$enable_backend_firebird -else - WANT_BACKEND_FIREBIRD="no" - -fi; - -FIREBIRD_DIRS="" -if test "$WANT_BACKEND_FIREBIRD" = "yes"; then - - FIREBIRD_REQ_VERSION="1.5.0" - - -# Check whether --with-firebird or --without-firebird was given. -if test "${with_firebird+set}" = set; then - withval="$with_firebird" - - if test "$withval" = "no"; then - WANT_FIREBIRD="no" - elif test "$withval" = "yes"; then - WANT_FIREBIRD="yes" - ac_firebird_path="" - else - WANT_FIREBIRD="yes" - ac_firebird_path="$withval" - fi - -else - WANT_FIREBIRD="yes" - -fi; - - FIREBIRD_CFLAGS="" - FIREBIRD_LDFLAGS="" - FIREBIRD_VERSION="" - - if test "x$WANT_FIREBIRD" = "xyes"; then - - ac_firebird_header="ibase.h" - - firebird_version_req=$FIREBIRD_REQ_VERSION - firebird_version_req_shorten=`expr $firebird_version_req : '\([0-9]*\.[0-9]*\)'` - firebird_version_req_major=`expr $firebird_version_req : '\([0-9]*\)'` - firebird_version_req_minor=`expr $firebird_version_req : '[0-9]*\.\([0-9]*\)'` - firebird_version_req_micro=`expr $firebird_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'` - if test "x$firebird_version_req_micro" = "x" ; then - firebird_version_req_micro="0" - fi - - - firebird_version_req_number=`expr $firebird_version_req_major \+ $firebird_version_req_minor` - - echo "$as_me:$LINENO: checking for Firebird client library >= $firebird_version_req" >&5 -echo $ECHO_N "checking for Firebird client library >= $firebird_version_req... $ECHO_C" >&6 - - if test "$ac_firebird_path" != ""; then - ac_firebird_ldflags="-L$ac_firebird_path/lib" - ac_firebird_cppflags="-I$ac_firebird_path/include" - else - for ac_firebird_path_tmp in /usr /usr/local /opt ; do - if test -f "$ac_firebird_path_tmp/include/$ac_firebird_header" \ - && test -r "$ac_firebird_path_tmp/include/$ac_firebird_header"; then - ac_firebird_path=$ac_firebird_path_tmp - ac_firebird_cppflags="-I$ac_firebird_path_tmp/include" - ac_firebird_ldflags="-L$ac_firebird_path_tmp/lib" - break; - fi - done - fi - - ac_firebird_header_path="$ac_firebird_path/include/$ac_firebird_header" - - if test ! -f "$ac_firebird_header_path"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - success="no" - else - - ac_firebird_ldflags="$ac_firebird_ldflags -lfbclient -lpthread" - - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $ac_firebird_cppflags" - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ibase.h> -int -main () -{ - -#if (FB_API_VER >= $firebird_version_req_number) -// Everything is okay -#else -# error Firebird version is too old -#endif - - - ; - return 0; -} - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - success="yes" - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6 - succees="no" - - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - CPPFLAGS="$saved_CPPFLAGS" - - if test "$success" = "yes"; then - - FIREBIRD_CFLAGS="$ac_firebird_cppflags" - FIREBIRD_LDFLAGS="$ac_firebird_ldflags" - - - ac_firebird_version=`cat $ac_firebird_header_path | \ - grep '#define.*FB_API_VER.*' | \ - sed -e 's/.* //'` - - if test -n "$ac_firebird_version"; then - ac_firebird_version_major=`expr $ac_firebird_version \/ 10` - ac_firebird_version_minor=`expr $ac_firebird_version \% 10` - - FIREBIRD_VERSION="$ac_firebird_version_major.$ac_firebird_version_minor.x" - else - { echo "$as_me:$LINENO: WARNING: Could not find FB_API_VER macro in $ac_firebird_header to get Firebird version." >&5 -echo "$as_me: WARNING: Could not find FB_API_VER macro in $ac_firebird_header to get Firebird version." >&2;} - fi - - - - - cat >>confdefs.h <<\_ACEOF -#define HAVE_FIREBIRD 1 -_ACEOF - - fi - fi - fi - - - if test -n "$FIREBIRD_CFLAGS" -a -n "$FIREBIRD_LDFLAGS"; then - FIREBIRD_DIRS="firebird firebird/test" - fi -fi - - - - -# Check whether --enable-backend-mysql or --disable-backend-mysql was given. -if test "${enable_backend_mysql+set}" = set; then - enableval="$enable_backend_mysql" - WANT_BACKEND_MYSQL=$enable_backend_mysql -else - WANT_BACKEND_MYSQL="no" - -fi; - -MYSQL_DIRS="" -if test "$WANT_BACKEND_MYSQL" = "yes"; then - - MYSQL_REQ_VERSION="3.0.0" - - -# Check whether --with-mysql or --without-mysql was given. -if test "${with_mysql+set}" = set; then - withval="$with_mysql" - - if test "$withval" = "no"; then - want_mysql="no" - elif test "$withval" = "yes"; then - want_mysql="yes" - else - want_mysql="yes" - MYSQL_CONFIG="$withval" - fi - -else - want_mysql="yes" - -fi; - - MYSQL_CFLAGS="" - MYSQL_LDFLAGS="" - MYSQL_VERSION="" - - - if test "$want_mysql" = "yes"; then - - if test -z "$MYSQL_CONFIG" -o test; then - # Extract the first word of "mysql_config", so it can be a program name with args. -set dummy mysql_config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MYSQL_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MYSQL_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_MYSQL_CONFIG="$MYSQL_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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -MYSQL_CONFIG=$ac_cv_path_MYSQL_CONFIG - -if test -n "$MYSQL_CONFIG"; then - echo "$as_me:$LINENO: result: $MYSQL_CONFIG" >&5 -echo "${ECHO_T}$MYSQL_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - fi - - if test ! -x "$MYSQL_CONFIG"; then - { { echo "$as_me:$LINENO: error: $MYSQL_CONFIG does not exist or it is not an exectuable file" >&5 -echo "$as_me: error: $MYSQL_CONFIG does not exist or it is not an exectuable file" >&2;} - { (exit 1); exit 1; }; } - MYSQL_CONFIG="no" - found_mysql="no" - fi - - if test "$MYSQL_CONFIG" != "no"; then - echo "$as_me:$LINENO: checking for MySQL libraries" >&5 -echo $ECHO_N "checking for MySQL libraries... $ECHO_C" >&6 - - MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`" - MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`" - - MYSQL_VERSION=`$MYSQL_CONFIG --version` - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MYSQL 1 -_ACEOF - - - found_mysql="yes" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - found_mysql="no" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - fi - - - - mysql_version_req=$MYSQL_REQ_VERSION - - if test "$found_mysql" = "yes" -a -n "$mysql_version_req"; then - - echo "$as_me:$LINENO: checking if MySQL version is >= $mysql_version_req" >&5 -echo $ECHO_N "checking if MySQL version is >= $mysql_version_req... $ECHO_C" >&6 - - mysql_version_req_major=`expr $mysql_version_req : '\([0-9]*\)'` - mysql_version_req_minor=`expr $mysql_version_req : '[0-9]*\.\([0-9]*\)'` - mysql_version_req_micro=`expr $mysql_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'` - if test "x$mysql_version_req_micro" = "x"; then - mysql_version_req_micro="0" - fi - - mysql_version_req_number=`expr $mysql_version_req_major \* 1000000 \ - \+ $mysql_version_req_minor \* 1000 \ - \+ $mysql_version_req_micro` - - mysql_version_major=`expr $MYSQL_VERSION : '\([0-9]*\)'` - mysql_version_minor=`expr $MYSQL_VERSION : '[0-9]*\.\([0-9]*\)'` - mysql_version_micro=`expr $MYSQL_VERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'` - if test "x$mysql_version_micro" = "x"; then - mysql_version_micro="0" - fi - - mysql_version_number=`expr $mysql_version_major \* 1000000 \ - \+ $mysql_version_minor \* 1000 \ - \+ $mysql_version_micro` - - mysql_version_check=`expr $mysql_version_number \>\= $mysql_version_req_number` - if test "$mysql_version_check" = "1"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - fi - - - - - - - if test -n "$MYSQL_CFLAGS" -a -n "$MYSQL_LDFLAGS"; then - MYSQL_DIRS="mysql mysql/test" - fi -fi - - - - -WANT_BACKEND_ODBC="yes" -ODBC_DIRS="odbc odbc/test" - - - -# Check whether --enable-backend-oracle or --disable-backend-oracle was given. -if test "${enable_backend_oracle+set}" = set; then - enableval="$enable_backend_oracle" - WANT_BACKEND_ORACLE=$enable_backend_oracle -else - WANT_BACKEND_ORACLE="no" - -fi; - -ORACLE_DIRS="" -if test "$WANT_BACKEND_ORACLE" = "yes"; then - - ORACLE_OCI_REQ_VERSION="9.0" - - -# Check whether --with-oracle or --without-oracle was given. -if test "${with_oracle+set}" = set; then - withval="$with_oracle" - - if test "$withval" = "yes"; then - if test -n "$ORACLE_HOME"; then - oracle_home_dir="$ORACLE_HOME" - else - oracle_home_dir="" - fi - fi - -else - - if test -n "$ORACLE_HOME"; then - oracle_home_dir="$ORACLE_HOME" - else - oracle_home_dir="" - fi - - -fi; - - -# Check whether --with-oracle-include or --without-oracle-include was given. -if test "${with_oracle_include+set}" = set; then - withval="$with_oracle_include" - oracle_home_include_dir="$withval" -else - oracle_home_include_dir="" - -fi; - -# Check whether --with-oracle-lib or --without-oracle-lib was given. -if test "${with_oracle_lib+set}" = set; then - withval="$with_oracle_lib" - oracle_home_lib_dir="$withval" -else - oracle_home_lib_dir="" - -fi; - - ORACLE_OCI_CFLAGS="" - ORACLE_OCI_LDFLAGS="" - ORACLE_OCI_VERSION="" - - want_oracle_but_no_path="no" - - if test -n "$oracle_home_dir"; then - - if test "$oracle_home_dir" != "no" -a "$oracle_home_dir" != "yes"; then - - oracle_include_dir="$oracle_home_dir/rdbms/public" - - oracle_include_dir2="$oracle_home_dir/rdbms/demo" - - oracle_lib_dir="$oracle_home_dir/lib" - elif test "$oracle_home_dir" = "yes"; then - want_oracle_but_no_path="yes" - fi - - elif test -n "$oracle_home_include_dir" -o -n "$oracle_home_lib_dir"; then - - if test "$oracle_home_include_dir" != "no" -a "$oracle_home_include_dir" != "yes"; then - oracle_include_dir="$oracle_home_include_dir" - elif test "$oracle_home_include_dir" = "yes"; then - want_oracle_but_no_path="yes" - fi - - if test "$oracle_home_lib_dir" != "no" -a "$oracle_home_lib_dir" != "yes"; then - oracle_lib_dir="$oracle_home_lib_dir" - elif test "$oracle_home_lib_dir" = "yes"; then - want_oracle_but_no_path="yes" - fi - fi - - if test "$want_oracle_but_no_path" = "yes"; then - { echo "$as_me:$LINENO: WARNING: Oracle support is requested but no Oracle paths have been provided. \ -Please, locate Oracle directories using --with-oracle or \ ---with-oracle-include and --with-oracle-lib options." >&5 -echo "$as_me: WARNING: Oracle support is requested but no Oracle paths have been provided. \ -Please, locate Oracle directories using --with-oracle or \ ---with-oracle-include and --with-oracle-lib options." >&2;} - fi - - if test -n "$oracle_include_dir" -a -n "$oracle_lib_dir"; then - - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$oracle_include_dir" - - if test -n "$oracle_include_dir2"; then - CPPFLAGS="$CPPFLAGS -I$oracle_include_dir2" - fi - - saved_LDFLAGS="$LDFLAGS" - oci_ldflags="-L$oracle_lib_dir -lclntsh -lnnz10" - LDFLAGS="$LDFLAGS $oci_ldflags" - - echo "$as_me:$LINENO: checking for Oracle OCI headers in $oracle_include_dir" >&5 -echo $ECHO_N "checking for Oracle OCI headers in $oracle_include_dir... $ECHO_C" >&6 - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <oci.h> -int -main () -{ - -#if defined(OCI_MAJOR_VERSION) -#if OCI_MAJOR_VERSION == 10 && OCI_MINOR_VERSION == 2 -// Oracle 10.2 detected -#endif -#elif defined(OCI_V7_SYNTAX) -// OK, older Oracle detected -// TODO - mloskot: find better macro to check for older versions; -#else -# error Oracle oci.h header not found -#endif - - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - ORACLE_OCI_CFLAGS="-I$oracle_include_dir" - - if test -n "$oracle_include_dir2"; then - ORACLE_OCI_CFLAGS="$ORACLE_OCI_CFLAGS -I$oracle_include_dir2" - fi - - oci_header_found="yes" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - oci_header_found="no" - echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6 - - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - if test "$oci_header_found" = "yes"; then - - echo "$as_me:$LINENO: checking for Oracle OCI libraries in $oracle_lib_dir" >&5 -echo $ECHO_N "checking for Oracle OCI libraries in $oracle_lib_dir... $ECHO_C" >&6 - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <oci.h> -int -main () -{ - -OCIEnv* envh = 0; -OCIEnvCreate(&envh, OCI_DEFAULT, 0, 0, 0, 0, 0, 0); -if (envh) OCIHandleFree(envh, OCI_HTYPE_ENV); - - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - ORACLE_OCI_LDFLAGS="$oci_ldflags" - oci_lib_found="yes" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - oci_lib_found="no" - echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6 - - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - fi - - CPPFLAGS="$saved_CPPFLAGS" - LDFLAGS="$saved_LDFLAGS" - fi - - oracle_version_req=$ORACLE_OCI_REQ_VERSION - - if test "$oci_header_found" = "yes" -a "$oci_lib_found" = "yes" -a \ - -n "$oracle_version_req"; then - - oracle_version_major=`cat $oracle_include_dir/oci.h \ - | grep '#define.*OCI_MAJOR_VERSION.*' \ - | sed -e 's/#define OCI_MAJOR_VERSION *//' \ - | sed -e 's/ *\/\*.*\*\///'` - - oracle_version_minor=`cat $oracle_include_dir/oci.h \ - | grep '#define.*OCI_MINOR_VERSION.*' \ - | sed -e 's/#define OCI_MINOR_VERSION *//' \ - | sed -e 's/ *\/\*.*\*\///'` - - echo "$as_me:$LINENO: checking if Oracle OCI version is >= $oracle_version_req" >&5 -echo $ECHO_N "checking if Oracle OCI version is >= $oracle_version_req... $ECHO_C" >&6 - - if test -n "$oracle_version_major" -a -n $"oracle_version_minor"; then - - ORACLE_OCI_VERSION="$oracle_version_major.$oracle_version_minor" - - oracle_version_req_major=`expr $oracle_version_req : '\([0-9]*\)'` - oracle_version_req_minor=`expr $oracle_version_req : '[0-9]*\.\([0-9]*\)'` - - oracle_version_req_number=`expr $oracle_version_req_major \* 1000000 \ - \+ $oracle_version_req_minor \* 1000` - - oracle_version_number=`expr $oracle_version_major \* 1000000 \ - \+ $oracle_version_minor \* 1000` - - oracle_version_check=`expr $oracle_version_number \>\= $oracle_version_req_number` - if test "$oracle_version_check" = "1"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - { { echo "$as_me:$LINENO: error: Oracle $ORACLE_OCI_VERSION found, but required version is $oracle_version_req" >&5 -echo "$as_me: error: Oracle $ORACLE_OCI_VERSION found, but required version is $oracle_version_req" >&2;} - { (exit 1); exit 1; }; } - fi - else - ORACLE_OCI_VERSION="UNKNOWN" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - { echo "$as_me:$LINENO: WARNING: Oracle version unknown, probably OCI older than 10.2 is available" >&5 -echo "$as_me: WARNING: Oracle version unknown, probably OCI older than 10.2 is available" >&2;} - fi - fi - - - - - - - if test -n "$ORACLE_OCI_CFLAGS" -a -n "$ORACLE_OCI_LDFLAGS"; then - ORACLE_DIRS="oracle oracle/test" - fi -fi - - - - -# Check whether --enable-backend-postgresql or --disable-backend-postgresql was given. -if test "${enable_backend_postgresql+set}" = set; then - enableval="$enable_backend_postgresql" - WANT_BACKEND_POSTGRESQL=$enable_backend_postgresql -else - WANT_BACKEND_POSTGRESQL="no" - -fi; - -POSTGRESQL_DIRS="" -if test "$WANT_BACKEND_POSTGRESQL" = "yes"; then - - POSTGRESQL_REQ_VERSION="7.1.4" - - -# Check whether --with-postgresql or --without-postgresql was given. -if test "${with_postgresql+set}" = set; then - withval="$with_postgresql" - - if test "$withval" = "no"; then - want_postgresql="no" - elif test "$withval" = "yes"; then - want_postgresql="yes" - else - want_postgresql="yes" - PG_CONFIG="$withval" - fi - -else - want_postgresql="yes" - -fi; - - POSTGRESQL_CFLAGS="" - POSTGRESQL_LDFLAGS="" - POSTGRESQL_POSTGRESQL="" - - - if test "$want_postgresql" = "yes"; then - - if test -z "$PG_CONFIG" -o test; then - # Extract the first word of "pg_config", so it can be a program name with args. -set dummy pg_config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -PG_CONFIG=$ac_cv_path_PG_CONFIG - -if test -n "$PG_CONFIG"; then - echo "$as_me:$LINENO: result: $PG_CONFIG" >&5 -echo "${ECHO_T}$PG_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - fi - - if test ! -x "$PG_CONFIG"; then - { { echo "$as_me:$LINENO: error: $PG_CONFIG does not exist or it is not an exectuable file" >&5 -echo "$as_me: error: $PG_CONFIG does not exist or it is not an exectuable file" >&2;} - { (exit 1); exit 1; }; } - PG_CONFIG="no" - found_postgresql="no" - fi - - if test "$PG_CONFIG" != "no"; then - echo "$as_me:$LINENO: checking for PostgreSQL libraries" >&5 -echo $ECHO_N "checking for PostgreSQL libraries... $ECHO_C" >&6 - - POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`" - POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq" - - POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'` - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_POSTGRESQL 1 -_ACEOF - - - found_postgresql="yes" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - found_postgresql="no" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - fi - - - - postgresql_version_req=$POSTGRESQL_REQ_VERSION - - if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then - - echo "$as_me:$LINENO: checking if PostgreSQL version is >= $postgresql_version_req" >&5 -echo $ECHO_N "checking if PostgreSQL version is >= $postgresql_version_req... $ECHO_C" >&6 - - postgresql_version_req_major=`expr $postgresql_version_req : '\([0-9]*\)'` - postgresql_version_req_minor=`expr $postgresql_version_req : '[0-9]*\.\([0-9]*\)'` - postgresql_version_req_micro=`expr $postgresql_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'` - if test "x$postgresql_version_req_micro" = "x"; then - postgresql_version_req_micro="0" - fi - - postgresql_version_req_number=`expr $postgresql_version_req_major \* 1000000 \ - \+ $postgresql_version_req_minor \* 1000 \ - \+ $postgresql_version_req_micro` - - postgresql_version_major=`expr $POSTGRESQL_VERSION : '\([0-9]*\)'` - postgresql_version_minor=`expr $POSTGRESQL_VERSION : '[0-9]*\.\([0-9]*\)'` - postgresql_version_micro=`expr $POSTGRESQL_VERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'` - if test "x$postgresql_version_micro" = "x"; then - postgresql_version_micro="0" - fi - - postgresql_version_number=`expr $postgresql_version_major \* 1000000 \ - \+ $postgresql_version_minor \* 1000 \ - \+ $postgresql_version_micro` - - postgresql_version_check=`expr $postgresql_version_number \>\= $postgresql_version_req_number` - if test "$postgresql_version_check" = "1"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - fi - - - - - - - if test -n "$POSTGRESQL_CFLAGS" -a -n "$POSTGRESQL_LDFLAGS"; then - POSTGRESQL_DIRS="postgresql postgresql/test" - fi -fi - - - - -# Check whether --enable-backend-sqlite3 or --disable-backend-sqlite3 was given. -if test "${enable_backend_sqlite3+set}" = set; then - enableval="$enable_backend_sqlite3" - WANT_BACKEND_SQLITE3=$enable_backend_sqlite3 -else - WANT_BACKEND_SQLITE3="no" - -fi; - -SQLITE3_DIRS="" -if test "$WANT_BACKEND_SQLITE3" = "yes"; then - SQLITE3_REQ_VERSION="3.0.0" - - -# Check whether --with-sqlite3 or --without-sqlite3 was given. -if test "${with_sqlite3+set}" = set; then - withval="$with_sqlite3" - - if test "$withval" = "no"; then - WANT_SQLITE3="no" - elif test "$withval" = "yes"; then - WANT_SQLITE3="yes" - ac_sqlite3_path="" - else - WANT_SQLITE3="yes" - ac_sqlite3_path="$withval" - fi - -else - WANT_SQLITE3="yes" - -fi; - - SQLITE3_CFLAGS="" - SQLITE3_LDFLAGS="" - SQLITE3_VERSION="" - - if test "x$WANT_SQLITE3" = "xyes"; then - - ac_sqlite3_header="sqlite3.h" - - sqlite3_version_req=$SQLITE3_REQ_VERSION - sqlite3_version_req_shorten=`expr $sqlite3_version_req : '\([0-9]*\.[0-9]*\)'` - sqlite3_version_req_major=`expr $sqlite3_version_req : '\([0-9]*\)'` - sqlite3_version_req_minor=`expr $sqlite3_version_req : '[0-9]*\.\([0-9]*\)'` - sqlite3_version_req_micro=`expr $sqlite3_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'` - if test "x$sqlite3_version_req_micro" = "x" ; then - sqlite3_version_req_micro="0" - fi - - sqlite3_version_req_number=`expr $sqlite3_version_req_major \* 1000000 \ - \+ $sqlite3_version_req_minor \* 1000 \ - \+ $sqlite3_version_req_micro` - - echo "$as_me:$LINENO: checking for SQLite3 library >= $sqlite3_version_req" >&5 -echo $ECHO_N "checking for SQLite3 library >= $sqlite3_version_req... $ECHO_C" >&6 - - if test "$ac_sqlite3_path" != ""; then - ac_sqlite3_ldflags="-L$ac_sqlite3_path/lib" - ac_sqlite3_cppflags="-I$ac_sqlite3_path/include" - else - for ac_sqlite3_path_tmp in /usr /usr/local /opt ; do - if test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" \ - && test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header"; then - ac_sqlite3_path=$ac_sqlite3_path_tmp - ac_sqlite3_ldflags="-I$ac_sqlite3_path_tmp/include" - ac_sqlite3_cppflags="-L$ac_sqlite3_path_tmp/lib" - break; - fi - done - fi - - ac_sqlite3_ldflags="$ac_sqlite3_ldflags -lsqlite3" - - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $ac_sqlite3_cppflags" - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sqlite3.h> -int -main () -{ - -#if (SQLITE_VERSION_NUMBER >= $sqlite3_version_req_number) -// Everything is okay -#else -# error SQLite version is too old -#endif - - - ; - return 0; -} - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - success="yes" - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6 - succees="no" - - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - CPPFLAGS="$saved_CPPFLAGS" - - if test "$success" = "yes"; then - - SQLITE3_CFLAGS="$ac_sqlite3_cppflags" - SQLITE3_LDFLAGS="$ac_sqlite3_ldflags" - - ac_sqlite3_header_path="$ac_sqlite3_path/include/$ac_sqlite3_header" - - if test "x$ac_sqlite3_header_path" != "x"; then - ac_sqlite3_version=`cat $ac_sqlite3_header_path \ - | grep '#define.*SQLITE_VERSION.*\"' | sed -e 's/.* "//' \ - | sed -e 's/"//'` - if test $ac_sqlite3_version != ""; then - SQLITE3_VERSION=$ac_sqlite3_version - else - { echo "$as_me:$LINENO: WARNING: Can not find SQLITE_VERSION macro in sqlite3.h header to retrieve SQLite version!" >&5 -echo "$as_me: WARNING: Can not find SQLITE_VERSION macro in sqlite3.h header to retrieve SQLite version!" >&2;} - fi - fi - - - - - cat >>confdefs.h <<\_ACEOF -#define HAVE_SQLITE3 1 -_ACEOF - - fi - fi - - - if test -n "$SQLITE3_CFLAGS" -a -n "$SQLITE3_LDFLAGS"; then - SQLITE3_DIRS="sqlite3 sqlite3/test" - fi -fi - - - - - - - ac_config_files="$ac_config_files Makefile src/Makefile src/core/Makefile src/core/test/Makefile src/backends/Makefile src/backends/empty/Makefile src/backends/empty/test/Makefile src/backends/firebird/Makefile src/backends/firebird/test/Makefile src/backends/mysql/Makefile src/backends/mysql/test/Makefile src/backends/odbc/Makefile src/backends/odbc/test/Makefile src/backends/oracle/Makefile src/backends/oracle/test/Makefile src/backends/postgresql/Makefile src/backends/postgresql/test/Makefile src/backends/sqlite3/Makefile src/backends/sqlite3/test/Makefile" - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by SOCI $as_me 2.2.0, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Configuration commands: -$config_commands - -Report bugs to <bug-autoconf@gnu.org>." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -SOCI config.status 2.2.0 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS section. -# - -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - -_ACEOF - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/core/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/core/Makefile" ;; - "src/core/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/core/test/Makefile" ;; - "src/backends/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/Makefile" ;; - "src/backends/empty/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/empty/Makefile" ;; - "src/backends/empty/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/empty/test/Makefile" ;; - "src/backends/firebird/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/firebird/Makefile" ;; - "src/backends/firebird/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/firebird/test/Makefile" ;; - "src/backends/mysql/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/mysql/Makefile" ;; - "src/backends/mysql/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/mysql/test/Makefile" ;; - "src/backends/odbc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/odbc/Makefile" ;; - "src/backends/odbc/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/odbc/test/Makefile" ;; - "src/backends/oracle/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/oracle/Makefile" ;; - "src/backends/oracle/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/oracle/test/Makefile" ;; - "src/backends/postgresql/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/postgresql/Makefile" ;; - "src/backends/postgresql/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/postgresql/test/Makefile" ;; - "src/backends/sqlite3/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/sqlite3/Makefile" ;; - "src/backends/sqlite3/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/backends/sqlite3/test/Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@RELEASE_MAJOR@,$RELEASE_MAJOR,;t t -s,@RELEASE_MINOR@,$RELEASE_MINOR,;t t -s,@RELEASE_MICRO@,$RELEASE_MICRO,;t t -s,@RELEASE_VERSION@,$RELEASE_VERSION,;t t -s,@LIBTOOL_RELEASE@,$LIBTOOL_RELEASE,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CYGPATH_W@,$CYGPATH_W,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@install_sh@,$install_sh,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@mkdir_p@,$mkdir_p,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@am__leading_dot@,$am__leading_dot,;t t -s,@AMTAR@,$AMTAR,;t t -s,@am__tar@,$am__tar,;t t -s,@am__untar@,$am__untar,;t t -s,@CXX@,$CXX,;t t -s,@CXXFLAGS@,$CXXFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CXX@,$ac_ct_CXX,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@CXXDEPMODE@,$CXXDEPMODE,;t t -s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t -s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t -s,@CXXCPP@,$CXXCPP,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -s,@EGREP@,$EGREP,;t t -s,@LN_S@,$LN_S,;t t -s,@ECHO@,$ECHO,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@CPP@,$CPP,;t t -s,@F77@,$F77,;t t -s,@FFLAGS@,$FFLAGS,;t t -s,@ac_ct_F77@,$ac_ct_F77,;t t -s,@LIBTOOL@,$LIBTOOL,;t t -s,@SOCI_CORE_LIBRARY_NAME@,$SOCI_CORE_LIBRARY_NAME,;t t -s,@SOCI_EMPTY_LIBRARY_NAME@,$SOCI_EMPTY_LIBRARY_NAME,;t t -s,@SOCI_FIREBIRD_LIBRARY_NAME@,$SOCI_FIREBIRD_LIBRARY_NAME,;t t -s,@SOCI_MYSQL_LIBRARY_NAME@,$SOCI_MYSQL_LIBRARY_NAME,;t t -s,@SOCI_ORACLE_LIBRARY_NAME@,$SOCI_ORACLE_LIBRARY_NAME,;t t -s,@SOCI_ODBC_LIBRARY_NAME@,$SOCI_ODBC_LIBRARY_NAME,;t t -s,@SOCI_POSTGRESQL_LIBRARY_NAME@,$SOCI_POSTGRESQL_LIBRARY_NAME,;t t -s,@SOCI_SQLITE3_LIBRARY_NAME@,$SOCI_SQLITE3_LIBRARY_NAME,;t t -s,@EMPTY_DIRS@,$EMPTY_DIRS,;t t -s,@FIREBIRD_CFLAGS@,$FIREBIRD_CFLAGS,;t t -s,@FIREBIRD_LDFLAGS@,$FIREBIRD_LDFLAGS,;t t -s,@FIREBIRD_VERSION@,$FIREBIRD_VERSION,;t t -s,@FIREBIRD_DIRS@,$FIREBIRD_DIRS,;t t -s,@MYSQL_CONFIG@,$MYSQL_CONFIG,;t t -s,@MYSQL_VERSION@,$MYSQL_VERSION,;t t -s,@MYSQL_CFLAGS@,$MYSQL_CFLAGS,;t t -s,@MYSQL_LDFLAGS@,$MYSQL_LDFLAGS,;t t -s,@MYSQL_DIRS@,$MYSQL_DIRS,;t t -s,@ODBC_DIRS@,$ODBC_DIRS,;t t -s,@ORACLE_OCI_VERSION@,$ORACLE_OCI_VERSION,;t t -s,@ORACLE_OCI_CFLAGS@,$ORACLE_OCI_CFLAGS,;t t -s,@ORACLE_OCI_LDFLAGS@,$ORACLE_OCI_LDFLAGS,;t t -s,@ORACLE_DIRS@,$ORACLE_DIRS,;t t -s,@PG_CONFIG@,$PG_CONFIG,;t t -s,@POSTGRESQL_VERSION@,$POSTGRESQL_VERSION,;t t -s,@POSTGRESQL_CFLAGS@,$POSTGRESQL_CFLAGS,;t t -s,@POSTGRESQL_LDFLAGS@,$POSTGRESQL_LDFLAGS,;t t -s,@POSTGRESQL_DIRS@,$POSTGRESQL_DIRS,;t t -s,@SQLITE3_CFLAGS@,$SQLITE3_CFLAGS,;t t -s,@SQLITE3_LDFLAGS@,$SQLITE3_LDFLAGS,;t t -s,@SQLITE3_VERSION@,$SQLITE3_VERSION,;t t -s,@SQLITE3_DIRS@,$SQLITE3_DIRS,;t t -s,@ac_aux_dir@,$ac_aux_dir,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`(dirname "$file") 2>/dev/null || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} - { (exit 1); exit 1; }; }; } - - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - esac -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - - -echo "=====================================================" -echo " $PACKAGE_NAME Configuration Summary:" -echo "=====================================================" -echo " RELEASE_VERSION = $RELEASE_VERSION" -echo " LIBTOOL_VERSION = $LIBTOOL_VERSION" -echo -echo " HOST = $host" -echo " PREFIX = $prefix" -echo " CXX = $CXX" -echo " CXXFLAGS = $CXXFLAGS" -echo " CPPFLAGS = $CPPFLAGS" -echo " LDFLAGS = $LDFLAGS" -echo -echo " SOCI_BUILD_DEBUG = $SOCI_BUILD_DEBUG" -echo -echo " SOCI_LIBRARY_VERSION = $SOCI_LIBRARY_VERSION" -echo " SOCI_LIBRARY_TOOLSET = $SOCI_LIBRARY_TOOLSET" -if test -z "$SOCI_LIBRARY_RUNTIME"; then -echo " SOCI_LIBRARY_RUNTIME = (release)" -else -echo " SOCI_LIBRARY_RUNTIME = $SOCI_LIBRARY_RUNTIME" -fi -echo - -if test "$VERBOSE" = "yes"; then - echo " CXX_TOOLSET_VENDOR = $CXX_TOOLSET_VENDOR" - echo " CXX_TOOLSET_FULLNAME = $CXX_TOOLSET_FULLNAME" - echo " CXX_TOOLSET_NAME = $CXX_TOOLSET_NAME" - echo " CXX_TOOLSET_COMMAND = $CXX_TOOLSET_COMMAND" - echo -fi - -echo "================================" -echo " SOCI Backends Configuration:" -echo "================================" -echo -echo " Build Empty = $WANT_BACKEND_EMPTY" -echo -echo " SOCI_EMPTY_LIBRARY_NAME = $SOCI_EMPTY_LIBRARY_NAME" -echo - -BACKENDS_COUNT=1 - -if test "$WANT_BACKEND_FIREBIRD" = "yes"; then - echo " Firebird (>= $FIREBIRD_REQ_VERSION):" - echo " ==============================" - if test -n "$FIREBIRD_CFLAGS" -a -n "$FIREBIRD_LDFLAGS"; then - echo " FIREBIRD_VERSION = $FIREBIRD_VERSION" - echo " FIREBIRD_CFLAGS = $FIREBIRD_CFLAGS" - echo " FIREBIRD_LDFLAGS = $FIREBIRD_LDFLAGS" - echo - echo " SOCI_FIREBIRD_LIBRARY_NAME = $SOCI_FIREBIRD_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING:" - echo " *** Firebird backend requested but 'fbclient' library not found." - echo " *** Use --with-firebird parameter to set library prefix manually." - echo " *** If you run 'make' now, Firebird backend will not be compiled." - fi - echo -fi - -if test "$WANT_BACKEND_MYSQL" = "yes"; then - echo " MySQL (>= $MYSQL_REQ_VERSION):" - echo " ==============================" - if test -n "$MYSQL_CFLAGS" -a -n "$MYSQL_LDFLAGS"; then - echo " MYSQL_VERSION = $MYSQL_VERSION" - echo " MYSQL_CFLAGS = $MYSQL_CFLAGS" - echo " MYSQL_LDFLAGS = $MYSQL_LDFLAGS" - echo - echo " SOCI_MYSQL_LIBRARY_NAME = $SOCI_MYSQL_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING:" - echo " *** MySQL backend requested but 'mysqlclient' library not found." - echo " *** Use --with-mysql parameter to set 'mysql_config' path manually." - echo " *** If you run 'make' now, MySQL backend will not be compiled." - fi - echo -fi - -if test "$WANT_BACKEND_ORACLE" = "yes"; then - echo " Oracle (>= $ORACLE_OCI_REQ_VERSION):" - echo " ==============================" - if test -n "$ORACLE_OCI_CFLAGS" -a -n "$ORACLE_OCI_LDFLAGS"; then - echo " ORACLE_OCI_VERSION = $ORACLE_OCI_VERSION" - echo " ORACLE_OCI_CFLAGS = $ORACLE_OCI_CFLAGS" - echo " ORACLE_OCI_LDFLAGS = $ORACLE_OCI_LDFLAGS" - echo - echo " SOCI_ORACLE_LIBRARY_NAME = $SOCI_ORACLE_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING:" - echo " *** Oracle backend requested but 'OCI' library not found." - echo " *** Use --with-oracle options to provide Oracle paths." - echo " *** If you run 'make' now, Oracle backend will not be compiled." - fi - echo -fi - -if test "$WANT_BACKEND_POSTGRESQL" = "yes"; then - echo " PostgreSQL (>= $POSTGRESQL_REQ_VERSION):" - echo " ==============================" - if test -n "$POSTGRESQL_CFLAGS" -a -n "$POSTGRESQL_LDFLAGS"; then - echo " POSTGRESQL_VERSION = $POSTGRESQL_VERSION" - echo " POSTGRESQL_CFLAGS = $POSTGRESQL_CFLAGS" - echo " POSTGRESQL_LDFLAGS = $POSTGRESQL_LDFLAGS" - echo - echo " SOCI_POSTGRESQL_LIBRARY_NAME = $SOCI_POSTGRESQL_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING:" - echo " *** PostgreSQL backend requested but 'libpq' library not found." - echo " *** Use --with-postgresql parameter to set 'pg_config' path manually." - echo " *** If you run 'make' now, PostgreSQL backend will not be compiled." - fi - echo -fi - -if test "$WANT_BACKEND_SQLITE3" = "yes"; then - echo " SQLite 3 (>= $SQLITE3_REQ_VERSION):" - echo " ==============================" - if test -n "$SQLITE3_CFLAGS" -a -n "$SQLITE3_LDFLAGS"; then - echo " SQLITE3_VERSION = $SQLITE3_VERSION" - echo " SQLITE3_CFLAGS = $SQLITE3_CFLAGS" - echo " SQLITE3_LDFLAGS = $SQLITE3_LDFLAGS" - echo - echo " SOCI_SQLITE3_LIBRARY_NAME = $SOCI_SQLITE3_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING: SQLite 3 backend requested but required SQLite $SQLITE3_REQ_VERSION not found." - echo " Use --with-sqlite3 parameter to set SQLite 3 installation prefix." - fi - echo -fi - -if test $BACKENDS_COUNT = 1; then - echo " WARNING: Only 'empty' backend is configured!" - echo " Type './configure --help' to learn about supported backends." - echo -fi +echo '' +cd build/unix; `cat local/tcl` parse-parameters.tcl -echo "Now, type 'make' to compile $PACKAGE_NAME." +echo '' +echo 'Configure done.' +echo 'Yes, it was short.' +echo '' +echo 'You can now run make.' diff --git a/configure.in b/configure.in deleted file mode 100644 index ba7a9834..00000000 --- a/configure.in +++ /dev/null @@ -1,522 +0,0 @@ -dnl $Id: configure.in,v 1.7 2006/11/27 09:59:31 mloskot Exp $ -dnl -dnl Copyright (C) 2006, Mateusz Loskot -dnl -dnl Author: Mateusz Loskot <mateusz@loskot.net> -dnl -dnl ------------------------------------------------------------------- -dnl SOCI version information -dnl ------------------------------------------------------------------- -dnl -dnl How to make a release: -dnl 1. Increment by 1 these macros: -dnl soci_version_micro, cpptk_interface_age, cpptk_binary_age. -dnl 2. If new functions have been added, set cpptk_interface_age to 0. -dnl 3. If backwards compatibility has been broken, set cpptk_binary_age -dnl and cpptk_interface_age to 0. -dnl ------------------------------------------------------------------- -m4_define([soci_version_major], [2]) -m4_define([soci_version_minor], [2]) -m4_define([soci_version_micro], [0]) -m4_define([soci_version], - [soci_version_major.soci_version_minor.soci_version_micro]) - -dnl NOTE: Not used, because SOCI does not libtool's versioning system. -m4_define([cpptk_interface_age], [0]) -m4_define([cpptk_binary_age], [0]) - - -dnl ------------------------------------------------------------------- -dnl *** DO NOT MODIFY ANYTHING BELOW THIS LINE *** -dnl ------------------------------------------------------------------- - - -dnl ------------------------------------------------------------------- -dnl Autoconf initialization -dnl ------------------------------------------------------------------- -AC_INIT([SOCI], - [soci_version], - [http://sourceforge.net/projects/soci], - [soci]) - - -dnl ------------------------------------------------------------------- -dnl C++/Tk release version (used by libtool's --release) -dnl ------------------------------------------------------------------- -RELEASE_MAJOR=soci_version_major -RELEASE_MINOR=soci_version_minor -RELEASE_MICRO=soci_version_micro -RELEASE_VERSION=soci_version - -AC_SUBST(RELEASE_MAJOR) -AC_SUBST(RELEASE_MINOR) -AC_SUBST(RELEASE_MICRO) -AC_SUBST(RELEASE_VERSION) - -LIBTOOL_RELEASE="soci_version" -AC_SUBST(LIBTOOL_RELEASE) - -dnl SOCI library version string after Boost naming convention -SOCI_LIBRARY_VERSION="${RELEASE_MAJOR}_${RELEASE_MINOR}" - - -dnl ------------------------------------------------------------------- -dnl Libtool versioning (used by libtool's --version-info) -dnl -dnl NOTE - mloskot: -dnl We don't use libtool's API versioning system, -dnl and there are no plans to use it in near future. -dnl ------------------------------------------------------------------- -dnl m4_define([lt_current], -dnl [m4_eval(soci_version_micro - cpptk_interface_age)]) -dnl m4_define([lt_revision], -dnl [cpptk_interface_age]) -dnl m4_define([lt_age], -dnl [m4_eval(cpptk_binary_age - cpptk_interface_age)]) -dnl -dnl LIBTOOL_VERSION="lt_current:lt_revision:lt_age" -dnl AC_SUBST(LIBTOOL_VERSION) - - -dnl ------------------------------------------------------------------- -dnl Automake initialization -dnl ------------------------------------------------------------------- -AM_INIT_AUTOMAKE - - -dnl ------------------------------------------------------------------- -dnl Check C++ capabilities -dnl ------------------------------------------------------------------- - -dnl Hack to get rid of setting -g -02 together, but let's user set -dnl these flags explicitly. -if test -z ${CXXFLAGS}; then - CXXFLAGS="" -fi - -AC_PROG_CXX -AC_LANG_CPLUSPLUS - -dnl Detect compiler and configure toolset to use it in library names -AX_CXX_TOOLSET - -SOCI_LIBRARY_TOOLSET="$CXX_TOOLSET_NAME" - - -dnl ------------------------------------------------------------------- -dnl Check libtool -dnl ------------------------------------------------------------------- -AM_PROG_LIBTOOL - - -dnl ------------------------------------------------------------------- -dnl Check other tools -dnl ------------------------------------------------------------------- -AC_PROG_MAKE_SET -AC_PROG_INSTALL - - -dnl ------------------------------------------------------------------- -dnl Set defaults -dnl ------------------------------------------------------------------- -AC_PREFIX_DEFAULT([/usr/local]) - - -dnl -------------------------------------------------------------------- -dnl Set recommended default flags for compiler and linker -dnl -------------------------------------------------------------------- -CXXFLAGS="${CXXFLAGS} -Wall -pedantic -Wno-long-long" - - -dnl -------------------------------------------------------------------- -dnl Detect compilation mode: debug or release -dnl -------------------------------------------------------------------- -AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug=@<:@yes|no@:>@], - [enable debug build @<:@default=no@:>@] - ), - [ - case "${enableval}" in - yes) SOCI_BUILD_DEBUG="yes" ;; - no) SOCI_BUILD_DEBUG="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug);; - esac - ], - [SOCI_BUILD_DEBUG="no"]) - -dnl SOCI library naming is based on Boost convention, for more details see -dnl http://www.boost.org/more/getting_started.html -dnl -dnl SOCI_LIBRARY_RUNTIME possible values: -dnl g - debug runtime -dnl s - static runtime (optional or not used yet) -dnl d - debug enabled (optional or not used yet) -dnl -if test "$SOCI_BUILD_DEBUG" = "yes"; then - SOCI_LIBRARY_RUNTIME="g" - CXXFLAGS="-g ${CXXFLAGS}" - CPPFLAGS="-D_DEBUG -UNDEBUG ${CPPFLAGS}" -else - SOCI_LIBRARY_RUNTIME="" - CXXFLAGS="${CXXFLAGS}" - CPPFLAGS="-DNDEBUG -U_DEBUG ${CPPFLAGS}" -fi - - -dnl ------------------------------------------------------------------- -dnl SOCI library names -dnl ------------------------------------------------------------------- - -dnl Common library prefix -SOCI_LIBRARY_PREFIX="soci" - -dnl Common library suffix -dnl -dnl TODO - mloskot: Add support of 's' and 'd' runtime modes. -dnl -if test -z "${SOCI_LIBRARY_RUNTIME}"; then - SOCI_LIBRARY_SUFFIX="${SOCI_LIBRARY_TOOLSET}-${SOCI_LIBRARY_VERSION}" -else - SOCI_LIBRARY_SUFFIX="${SOCI_LIBRARY_TOOLSET}-${SOCI_LIBRARY_RUNTIME}-${SOCI_LIBRARY_VERSION}" -fi - -SOCI_CORE_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_core-${SOCI_LIBRARY_SUFFIX}" -SOCI_EMPTY_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_empty-${SOCI_LIBRARY_SUFFIX}" -SOCI_FIREBIRD_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_firebird-${SOCI_LIBRARY_SUFFIX}" -SOCI_MYSQL_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_mysql-${SOCI_LIBRARY_SUFFIX}" -SOCI_ORACLE_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_oracle-${SOCI_LIBRARY_SUFFIX}" -SOCI_ODBC_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_odbc-${SOCI_LIBRARY_SUFFIX}" -SOCI_POSTGRESQL_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_postgresql-${SOCI_LIBRARY_SUFFIX}" -SOCI_SQLITE3_LIBRARY_NAME="${SOCI_LIBRARY_PREFIX}_sqlite3-${SOCI_LIBRARY_SUFFIX}" - -AC_SUBST([SOCI_CORE_LIBRARY_NAME]) -AC_SUBST([SOCI_EMPTY_LIBRARY_NAME]) -AC_SUBST([SOCI_FIREBIRD_LIBRARY_NAME]) -AC_SUBST([SOCI_MYSQL_LIBRARY_NAME]) -AC_SUBST([SOCI_ORACLE_LIBRARY_NAME]) -AC_SUBST([SOCI_ODBC_LIBRARY_NAME]) -AC_SUBST([SOCI_POSTGRESQL_LIBRARY_NAME]) -AC_SUBST([SOCI_SQLITE3_LIBRARY_NAME]) - - -dnl ------------------------------------------------------------------- -dnl Empty backend -dnl -dnl NOTE: Empty backend is always built-in -dnl ------------------------------------------------------------------- -WANT_BACKEND_EMPTY="yes" -EMPTY_DIRS="empty empty/test" -AC_SUBST([EMPTY_DIRS]) - - -dnl ------------------------------------------------------------------- -dnl Firebird backend -dnl ------------------------------------------------------------------- -AC_ARG_ENABLE([backend-firebird], - AC_HELP_STRING([--enable-backend-firebird=@<:@yes|no@:>@], - [build-in Firebird backend support @<:@default=no@:>@] - ), - [WANT_BACKEND_FIREBIRD=$enable_backend_firebird], - [WANT_BACKEND_FIREBIRD="no"] -) - -FIREBIRD_DIRS="" -if test "$WANT_BACKEND_FIREBIRD" = "yes"; then - - FIREBIRD_REQ_VERSION="1.5.0" - AX_LIB_FIREBIRD($FIREBIRD_REQ_VERSION) - - if test -n "$FIREBIRD_CFLAGS" -a -n "$FIREBIRD_LDFLAGS"; then - FIREBIRD_DIRS="firebird firebird/test" - fi -fi - -AC_SUBST([FIREBIRD_DIRS]) - - -dnl ------------------------------------------------------------------- -dnl MySQL backend -dnl ------------------------------------------------------------------- -AC_ARG_ENABLE([backend-mysql], - AC_HELP_STRING([--enable-backend-mysql=@<:@yes|no@:>@], - [build-in MySQL backend support @<:@default=no@:>@] - ), - [WANT_BACKEND_MYSQL=$enable_backend_mysql], - [WANT_BACKEND_MYSQL="no"] -) - -MYSQL_DIRS="" -if test "$WANT_BACKEND_MYSQL" = "yes"; then - - MYSQL_REQ_VERSION="3.0.0" - AX_LIB_MYSQL($MYSQL_REQ_VERSION) - - if test -n "$MYSQL_CFLAGS" -a -n "$MYSQL_LDFLAGS"; then - MYSQL_DIRS="mysql mysql/test" - fi -fi - -AC_SUBST([MYSQL_DIRS]) - - -dnl ------------------------------------------------------------------- -dnl ODBC backend -dnl -dnl NOTE: ODBC is configured for distribution only, nothing is compiled -dnl on Unix at the moment. -dnl ------------------------------------------------------------------- -WANT_BACKEND_ODBC="yes" -ODBC_DIRS="odbc odbc/test" -AC_SUBST([ODBC_DIRS]) - - -dnl ------------------------------------------------------------------- -dnl ORACLE backend -dnl ------------------------------------------------------------------- -AC_ARG_ENABLE([backend-oracle], - AC_HELP_STRING([--enable-backend-oracle=@<:@yes|no@:>@], - [build-in ORACLE backend support @<:@default=no@:>@] - ), - [WANT_BACKEND_ORACLE=$enable_backend_oracle], - [WANT_BACKEND_ORACLE="no"] -) - -ORACLE_DIRS="" -if test "$WANT_BACKEND_ORACLE" = "yes"; then - - ORACLE_OCI_REQ_VERSION="9.0" - AX_LIB_ORACLE_OCI($ORACLE_OCI_REQ_VERSION) - - if test -n "$ORACLE_OCI_CFLAGS" -a -n "$ORACLE_OCI_LDFLAGS"; then - ORACLE_DIRS="oracle oracle/test" - fi -fi - -AC_SUBST([ORACLE_DIRS]) - - -dnl ------------------------------------------------------------------- -dnl PostgreSQL backend -dnl ------------------------------------------------------------------- -AC_ARG_ENABLE([backend-postgresql], - AC_HELP_STRING([--enable-backend-postgresql=@<:@yes|no@:>@], - [build-in PostgreSQL backend support @<:@default=no@:>@] - ), - [WANT_BACKEND_POSTGRESQL=$enable_backend_postgresql], - [WANT_BACKEND_POSTGRESQL="no"] -) - -POSTGRESQL_DIRS="" -if test "$WANT_BACKEND_POSTGRESQL" = "yes"; then - - POSTGRESQL_REQ_VERSION="7.1.4" - AX_LIB_POSTGRESQL($POSTGRESQL_REQ_VERSION) - - if test -n "$POSTGRESQL_CFLAGS" -a -n "$POSTGRESQL_LDFLAGS"; then - POSTGRESQL_DIRS="postgresql postgresql/test" - fi -fi - -AC_SUBST([POSTGRESQL_DIRS]) - - -dnl ------------------------------------------------------------------- -dnl SQLite 3 backend -dnl ------------------------------------------------------------------- -AC_ARG_ENABLE([backend-sqlite3], - AC_HELP_STRING([--enable-backend-sqlite3=@<:@yes|no@:>@], - [build-in SQLite 3 backend support @<:@default=no@:>@] - ), - [WANT_BACKEND_SQLITE3=$enable_backend_sqlite3], - [WANT_BACKEND_SQLITE3="no"] -) - -SQLITE3_DIRS="" -if test "$WANT_BACKEND_SQLITE3" = "yes"; then - SQLITE3_REQ_VERSION="3.0.0" - AX_LIB_SQLITE3($SQLITE3_REQ_VERSION) - - if test -n "$SQLITE3_CFLAGS" -a -n "$SQLITE3_LDFLAGS"; then - SQLITE3_DIRS="sqlite3 sqlite3/test" - fi -fi - -AC_SUBST([SQLITE3_DIRS]) - - -dnl ------------------------------------------------------------------- -dnl Create Makefile files -dnl ------------------------------------------------------------------- -AC_SUBST(ac_aux_dir) - -AC_CONFIG_FILES([ - Makefile - src/Makefile - src/core/Makefile - src/core/test/Makefile - src/backends/Makefile - src/backends/empty/Makefile - src/backends/empty/test/Makefile - src/backends/firebird/Makefile - src/backends/firebird/test/Makefile - src/backends/mysql/Makefile - src/backends/mysql/test/Makefile - src/backends/odbc/Makefile - src/backends/odbc/test/Makefile - src/backends/oracle/Makefile - src/backends/oracle/test/Makefile - src/backends/postgresql/Makefile - src/backends/postgresql/test/Makefile - src/backends/sqlite3/Makefile - src/backends/sqlite3/test/Makefile -]) - -AC_OUTPUT - - -dnl ------------------------------------------------------------------- -dnl Print configuration summary -dnl ------------------------------------------------------------------- -echo "=====================================================" -echo " $PACKAGE_NAME Configuration Summary:" -echo "=====================================================" -echo " RELEASE_VERSION = $RELEASE_VERSION" -echo " LIBTOOL_VERSION = $LIBTOOL_VERSION" -echo -echo " HOST = $host" -echo " PREFIX = $prefix" -echo " CXX = $CXX" -echo " CXXFLAGS = $CXXFLAGS" -echo " CPPFLAGS = $CPPFLAGS" -echo " LDFLAGS = $LDFLAGS" -echo -echo " SOCI_BUILD_DEBUG = $SOCI_BUILD_DEBUG" -echo -echo " SOCI_LIBRARY_VERSION = $SOCI_LIBRARY_VERSION" -echo " SOCI_LIBRARY_TOOLSET = $SOCI_LIBRARY_TOOLSET" -if test -z "$SOCI_LIBRARY_RUNTIME"; then -echo " SOCI_LIBRARY_RUNTIME = (release)" -else -echo " SOCI_LIBRARY_RUNTIME = $SOCI_LIBRARY_RUNTIME" -fi -echo - -if test "$VERBOSE" = "yes"; then - echo " CXX_TOOLSET_VENDOR = $CXX_TOOLSET_VENDOR" - echo " CXX_TOOLSET_FULLNAME = $CXX_TOOLSET_FULLNAME" - echo " CXX_TOOLSET_NAME = $CXX_TOOLSET_NAME" - echo " CXX_TOOLSET_COMMAND = $CXX_TOOLSET_COMMAND" - echo -fi - -echo "================================" -echo " SOCI Backends Configuration:" -echo "================================" -echo -echo " Build Empty = $WANT_BACKEND_EMPTY" -echo -echo " SOCI_EMPTY_LIBRARY_NAME = $SOCI_EMPTY_LIBRARY_NAME" -echo - -BACKENDS_COUNT=1 - -if test "$WANT_BACKEND_FIREBIRD" = "yes"; then - echo " Firebird (>= $FIREBIRD_REQ_VERSION):" - echo " ==============================" - if test -n "$FIREBIRD_CFLAGS" -a -n "$FIREBIRD_LDFLAGS"; then - echo " FIREBIRD_VERSION = $FIREBIRD_VERSION" - echo " FIREBIRD_CFLAGS = $FIREBIRD_CFLAGS" - echo " FIREBIRD_LDFLAGS = $FIREBIRD_LDFLAGS" - echo - echo " SOCI_FIREBIRD_LIBRARY_NAME = $SOCI_FIREBIRD_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING:" - echo " *** Firebird backend requested but 'fbclient' library not found." - echo " *** Use --with-firebird parameter to set library prefix manually." - echo " *** If you run 'make' now, Firebird backend will not be compiled." - fi - echo -fi - -if test "$WANT_BACKEND_MYSQL" = "yes"; then - echo " MySQL (>= $MYSQL_REQ_VERSION):" - echo " ==============================" - if test -n "$MYSQL_CFLAGS" -a -n "$MYSQL_LDFLAGS"; then - echo " MYSQL_VERSION = $MYSQL_VERSION" - echo " MYSQL_CFLAGS = $MYSQL_CFLAGS" - echo " MYSQL_LDFLAGS = $MYSQL_LDFLAGS" - echo - echo " SOCI_MYSQL_LIBRARY_NAME = $SOCI_MYSQL_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING:" - echo " *** MySQL backend requested but 'mysqlclient' library not found." - echo " *** Use --with-mysql parameter to set 'mysql_config' path manually." - echo " *** If you run 'make' now, MySQL backend will not be compiled." - fi - echo -fi - -if test "$WANT_BACKEND_ORACLE" = "yes"; then - echo " Oracle (>= $ORACLE_OCI_REQ_VERSION):" - echo " ==============================" - if test -n "$ORACLE_OCI_CFLAGS" -a -n "$ORACLE_OCI_LDFLAGS"; then - echo " ORACLE_OCI_VERSION = $ORACLE_OCI_VERSION" - echo " ORACLE_OCI_CFLAGS = $ORACLE_OCI_CFLAGS" - echo " ORACLE_OCI_LDFLAGS = $ORACLE_OCI_LDFLAGS" - echo - echo " SOCI_ORACLE_LIBRARY_NAME = $SOCI_ORACLE_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING:" - echo " *** Oracle backend requested but 'OCI' library not found." - echo " *** Use --with-oracle options to provide Oracle paths." - echo " *** If you run 'make' now, Oracle backend will not be compiled." - fi - echo -fi - -if test "$WANT_BACKEND_POSTGRESQL" = "yes"; then - echo " PostgreSQL (>= $POSTGRESQL_REQ_VERSION):" - echo " ==============================" - if test -n "$POSTGRESQL_CFLAGS" -a -n "$POSTGRESQL_LDFLAGS"; then - echo " POSTGRESQL_VERSION = $POSTGRESQL_VERSION" - echo " POSTGRESQL_CFLAGS = $POSTGRESQL_CFLAGS" - echo " POSTGRESQL_LDFLAGS = $POSTGRESQL_LDFLAGS" - echo - echo " SOCI_POSTGRESQL_LIBRARY_NAME = $SOCI_POSTGRESQL_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING:" - echo " *** PostgreSQL backend requested but 'libpq' library not found." - echo " *** Use --with-postgresql parameter to set 'pg_config' path manually." - echo " *** If you run 'make' now, PostgreSQL backend will not be compiled." - fi - echo -fi - -if test "$WANT_BACKEND_SQLITE3" = "yes"; then - echo " SQLite 3 (>= $SQLITE3_REQ_VERSION):" - echo " ==============================" - if test -n "$SQLITE3_CFLAGS" -a -n "$SQLITE3_LDFLAGS"; then - echo " SQLITE3_VERSION = $SQLITE3_VERSION" - echo " SQLITE3_CFLAGS = $SQLITE3_CFLAGS" - echo " SQLITE3_LDFLAGS = $SQLITE3_LDFLAGS" - echo - echo " SOCI_SQLITE3_LIBRARY_NAME = $SOCI_SQLITE3_LIBRARY_NAME" - let "BACKENDS_COUNT += 1" - else - echo " WARNING: SQLite 3 backend requested but required SQLite $SQLITE3_REQ_VERSION not found." - echo " Use --with-sqlite3 parameter to set SQLite 3 installation prefix." - fi - echo -fi - -if test $BACKENDS_COUNT = 1; then - echo " WARNING: Only 'empty' backend is configured!" - echo " Type './configure --help' to learn about supported backends." - echo -fi - -echo "Now, type 'make' to compile $PACKAGE_NAME." diff --git a/contrib b/contrib index 670fb94a..e364d179 100644 --- a/contrib +++ b/contrib @@ -1,6 +1,31 @@ We would like to thank you for your contributions - they allowed us to improve the quality of the SOCI library: +--- +Rainer Bauer + +Rainer contributed the project files for Microsoft Visual C++ 8.0. + +--- +Martin Muenstermann + +Martin suggested an improvement for error reporting in PostgreSQL backend. + +--- +Philip Pemberton + +Philip contributed a patch for reading backend names. + +--- +Eli Green + +Eli provided various patches for the ODBC backend. + +--- +Artyom Tonkikh + +Artyom contributed the dynamic backend loading engine. + --- Roger Orr diff --git a/depcomp b/depcomp deleted file mode 100644 index 04701da5..00000000 --- a/depcomp +++ /dev/null @@ -1,530 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2005-07-09.11 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to <bug-automake@gnu.org>. -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/doc/backends.html b/doc/backends.html index 3614c7fc..103c04bc 100644 --- a/doc/backends.html +++ b/doc/backends.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -30,99 +30,104 @@ adjusted, cached, converted, etc.</p> <p>The interface to the common SOCI interface is defined in the <code>core/soci-backend.h</code> header file. This file is dissected below.</p> -<p>All names are defined in either <code>SOCI</code> or <code>SOCI::details</code> +<p>All names are defined in either <code>soci</code> or <code>soci::details</code> namespace.</p> <pre class="example"> // data types, as seen by the user -enum eDataType { eString, eChar, eDate, eDouble, eInteger, - eUnsignedLong }; +enum data_type +{ + dt_string, dt_date, dt_double, dt_integer, dt_unsigned_long, dt_long_long +}; // the enum type for indicator variables -enum eIndicator { eOK, eNoData, eNull, eTruncated }; +enum indicator { i_ok, i_null, i_truncated }; // data types, as used to describe exchange format -enum eExchangeType { eXChar, eXCString, eXStdString, eXShort, eXInteger, - eXUnsignedLong, eXDouble, eXStdTm, eXStatement, - eXRowID, eXBLOB }; +enum exchange_type +{ + x_char, x_cstring, x_stdstring, x_short, x_integer, + x_unsigned_long, x_long_long, x_double, x_stdtm, x_statement, + x_rowid, x_blob +}; -struct CStringDescriptor +struct cstring_descriptor { - CStringDescriptor(char *str, std::size_t bufSize) + cstring_descriptor(char * str, std::size_t bufSize) : str_(str), bufSize_(bufSize) {} - char *str_; + char * str_; std::size_t bufSize_; }; -class SOCIError : public std::runtime_error +// actually in error.h: +class soci_error : public std::runtime_error { public: - SOCIError(std::string const & msg, int errNum = 0); - - int errNum_; + soci_error(std::string const & msg); }; </pre> -<p>The <code>eDataType</code> enumeration type defines all types that +<p>The <code>data_type</code> enumeration type defines all types that form the core type support for SOCI. The enum itself can be used by clients when dealing with dynamic rowset description.</p> -<p>The <code>eIndicator</code> enumeration type defines all recognized <i>states</i> of data. The <code>eTruncated</code> +<p>The <code>indicator</code> enumeration type defines all recognized <i>states</i> of data. +The <code>i_truncated</code> state is provided for the case where the string is retrieved from the database into the char buffer that is not long enough to hold the whole value.</p> -<p>The <code>eExchangeType</code> enumeration type defines all possible +<p>The <code>exchange_type</code> enumeration type defines all possible types that can be used with the <code>into</code> and <code>use</code> elements.</p> -<p>The <code>CStringDescriptor</code> is a helper class that allows to +<p>The <code>cstring_descriptor</code> is a helper class that allows to store the address of <code>char</code> buffer together with its size. -The objects of this class are passed to the backend when the <code>eXCString</code> +The objects of this class are passed to the backend when the <code>x_cstring</code> type is involved.</p> -<p>The <code>SOCIError</code> class is an exception type used for +<p>The <code>soci_error</code> class is an exception type used for database-related (and also usage-related) errors. The backends should throw exceptions of this or derived type only.</p> <pre class="example"> -class StandardIntoTypeBackEnd +class standard_into_type_backend { public: - virtual ~StandardIntoTypeBackEnd() {} + virtual ~standard_into_type_backend() {} - virtual void defineByPos(int &position, - void *data, eExchangeType type) = 0; + virtual void define_by_pos(int & position, + void * data, exchange_type type) = 0; - virtual void preFetch() = 0; - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind) = 0; + virtual void pre_fetch() = 0; + virtual void post_fetch(bool gotData, bool calledFromFetch, + indicator * ind) = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; }; </pre> -<p>The <code>StandardIntoTypeBackEnd</code> class implements the dynamic +<p>The <code>standard_into_type_back_end</code> class implements the dynamic interactions with the simple (non-bulk) <code>into</code> elements. The objects of this class (or, rather, of the derived class implemented -by the actual backend) are created by the <code>Statement</code> +by the actual backend) are created by the <code>statement</code> object when the <code>into</code> element is bound - in terms of -lifetime management, <code>Statement</code> is the master of this +lifetime management, <code>statement</code> is the master of this class.</p> <ul> - <li><code>defineByPos</code> - Called when the <code>into</code> + <li><code>define_by_pos</code> - Called when the <code>into</code> element is bound, once and before the statement is executed. The <code>data</code> pointer points to the variable used for <code>into</code> element (or -to the <code>CStringDescriptor</code> object, which is artificially +to the <code>cstring_descriptor</code> object, which is artificially created when the plain <code>char</code> buffer is used for data exchange). The <code>position</code> parameter is a "column number", assigned by the library. The backend should increase this parameter, according to the number of fields actually taken (usually 1).</li> - <li><code>preFetch</code> - Called before each row is fetched.</li> - <li><code>postFetch</code> - Called after each row is fetched. The <code>gotData</code> + <li><code>pre_fetch</code> - Called before each row is fetched.</li> + <li><code>post_fetch</code> - Called after each row is fetched. The <code>gotData</code> parameter is <code>true</code> if the fetch operation really retrieved some data and <code>false</code> otherwise; <code>calledFromFetch</code> is <code>true</code> when the call is from the fetch operation and <code>false</code> @@ -131,11 +136,11 @@ one-time queries). In particular, <code>(calledFromFetch && !gotData)</code> indicates that there is an end-of-rowset condition. <code>ind</code> points to the indicator provided by the user, or is <code>NULL</code>, if there is no indicator.</li> - <li><code>cleanUp</code> - Called once when the statement is + <li><code>clean_up</code> - Called once when the statement is destroyed.</li> </ul> -<p>The intended use of <code>preFetch</code> and <code>postFetch</code> +<p>The intended use of <code>pre_fetch</code> and <code>post_fetch</code> functions is to manage any internal buffer and/or data conversion for each value retrieved from the database. If the given server supports binary data transmission and the data format for the given type agrees @@ -144,30 +149,30 @@ not do anything; otherwise buffer management and data conversions should go there.</p> <pre class="example"> -class VectorIntoTypeBackEnd +class vector_into_type_backend { public: - virtual ~VectorIntoTypeBackEnd() {} + virtual ~vector_into_type_backend() {} - virtual void defineByPos(int &position, - void *data, eExchangeType type) = 0; + virtual void define_by_pos(int & position, + void * data, exchange_type type) = 0; - virtual void preFetch() = 0; - virtual void postFetch(bool gotData, eIndicator *ind) = 0; + virtual void pre_fetch() = 0; + virtual void post_fetch(bool gotData, indicator * ind) = 0; virtual void resize(std::size_t sz) = 0; virtual std::size_t size() = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; }; </pre> -<p>The <code>VectorIntoTypeBackEnd</code> has similar structure and +<p>The <code>vector_into_type_back_end</code> has similar structure and purpose as the previous one, but is used for vectors (bulk data retrieval).</p> <p>The <code>data</code> pointer points to the variable of type <code>std::vector<T></code> -(<i>not</i> to its internal buffer), <code>resize</code> +(and <i>not</i> to its internal buffer), <code>resize</code> is supposed to really resize the user-provided vector and <code>size</code> is supposed to return the current size of this vector. The important difference with regard to the previous class is that <code>ind</code> @@ -176,113 +181,112 @@ should fill this array according to the actual state of the retrieved data.</p> <pre class="example"> -class StandardUseTypeBackEnd +class standard_use_type_backend { public: - virtual ~StandardUseTypeBackEnd() {} + virtual ~standard_use_type_backend() {} - virtual void bindByPos(int &position, - void *data, eExchangeType type) = 0; - virtual void bindByName(std::string const &name, - void *data, eExchangeType type) = 0; + virtual void bind_by_pos(int & position, + void * data, exchange_type type, bool readOnly) = 0; + virtual void bind_by_name(std::string const & name, + void * data, exchange_type type, bool readOnly) = 0; - virtual void preUse(eIndicator const *ind) = 0; - virtual void postUse(bool gotData, eIndicator *ind) = 0; + virtual void pre_use(indicator const * ind) = 0; + virtual void post_use(bool gotData, indicator * ind) = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; }; </pre> -<p>The <code>StandardUseTypeBackEnd</code> implements the interactions +<p>The <code>standard_use_type_backend</code> implements the interactions with the simple (non-bulk) <code>use</code> elements, created and -destroyed by the <code>Statement</code> object.</p> +destroyed by the <code>statement</code> object.</p> <ul> - <li><code>bindByPos</code> - Called for each <code>use</code> + <li><code>bind_by_pos</code> - Called for each <code>use</code> element, once and before the statement is executed - for those <code>use</code> elements that do not provide explicit names for parameter binding. The meaning of parameters is same as in previous classes.</li> - <li><code>bindByName</code> - Called for those <code>use</code> + <li><code>bind_by_name</code> - Called for those <code>use</code> elements that provide the explicit name.</li> - <li><code>preUse</code> - Called before the data is transmitted to + <li><code>pre_use</code> - Called before the data is transmitted to the server (this means before the statement is executed, which can happen many times for the prepared statement). <code>ind</code> points to the indicator provided by the user (or is <code>NULL</code>).</li> - <li><code>postUse</code> - Called after statement execution. <code>gotData</code> -and <code>ind</code> have the same meaning as in <code>StandardIntoTypeBackEnd::postFetch</code>, + <li><code>post_use</code> - Called after statement execution. <code>gotData</code> +and <code>ind</code> have the same meaning as in <code>standard_into_type_back_end::post_fetch</code>, and this can be used by those backends whose respective servers support two-way data exchange (like in/out parameters in stored procedures).</li> </ul> -<p>The intended use fot <code>preUse</code> and <code>postUse</code> +<p>The intended use for <code>pre_use</code> and <code>post_use</code> methods is to manage any internal buffers and/or data conversion. They can be called many times with the same statement.</p> <pre class="example"> -class VectorUseTypeBackEnd +class vector_use_type_backend { public: - virtual ~VectorUseTypeBackEnd() {} + virtual ~vector_use_type_backend() {} - virtual void bindByPos(int &position, - void *data, eExchangeType type) = 0; - virtual void bindByName(std::string const &name, - void *data, eExchangeType type) = 0; + virtual void bind_by_pos(int & position, + void * data, exchange_type type) = 0; + virtual void bind_by_name(std::string const & name, + void * data, exchange_type type) = 0; - virtual void preUse(eIndicator const *ind) = 0; + virtual void pre_use(indicator const * ind) = 0; virtual std::size_t size() = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; }; </pre> <p>Objects of this type (or rather of type derived from this one) are used to implement interactions with user-provided vector (bulk) <code>use</code> -elements and are managed by the <code>Statement</code> object. +elements and are managed by the <code>statement</code> object. The <code>data</code> pointer points to the whole vector object -provided by the user (<i>not</i> to +provided by the user (and <i>not</i> to its internal buffer); <code>ind</code> points to the beginning of the array of indicators (or is <code>NULL</code>). The meaning of this interface is analogous to those presented above.</p> <pre class="example"> -class StatementBackEnd +class statement_backend { public: - virtual ~StatementBackEnd() {} + virtual ~statement_backend() {} virtual void alloc() = 0; - virtual void cleanUp() = 0; - virtual void prepare(std::string const &query) = 0; + virtual void clean_up() = 0; + + virtual void prepare(std::string const & query, statement_type eType) = 0; - enum execFetchResult { eSuccess, eNoData }; - virtual execFetchResult execute(int number) = 0; - virtual execFetchResult fetch(int number) = 0; + enum exec_fetch_result { ef_success, ef_no_data }; + virtual exec_fetch_result execute(int number) = 0; + virtual exec_fetch_result fetch(int number) = 0; - virtual int getNumberOfRows() = 0; + virtual int get_number_of_rows() = 0; - virtual std::string rewriteForProcedureCall(std::string const &query) = 0; + virtual std::string rewrite_for_procedure_call(std::string const & query) = 0; - virtual int prepareForDescribe() = 0; - virtual void describeColumn(int colNum, eDataType &dtype, - std::string &columnName, int &size, int &precision, int &scale, - bool &nullOk) = 0; + virtual int prepare_for_describe() = 0; + virtual void describe_column(int colNum, data_type & dtype, + std::string & column_name) = 0; - virtual StandardIntoTypeBackEnd * makeIntoTypeBackEnd() = 0; - virtual StandardUseTypeBackEnd * makeUseTypeBackEnd() = 0; - virtual VectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd() = 0; - virtual VectorUseTypeBackEnd * makeVectorUseTypeBackEnd() = 0; + virtual standard_into_type_backend * make_into_type_backend() = 0; + virtual standard_use_type_backend * make_use_type_backend() = 0; + virtual vector_into_type_backend * make_vector_into_type_backend() = 0; + virtual vector_use_type_backend * make_vector_use_type_backend() = 0; }; </pre> -<p>The <code>StatementBackEnd</code> type implements the internals of the -<code>Statement</code> objects (in fact, it is a basic Strategy design -pattern). The objects of this class are created by the <code>Session</code> +<p>The <code>statement_backend</code> type implements the internals of the +<code>statement</code> objects. The objects of this class are created by the <code>session</code> object.</p> <ul> <li><code>alloc</code> - Called once to allocate everything that is needed for the statement to work correctly.</li> - <li><code>cleanUp</code> - Supposed to clean up the resources, called + <li><code>clean_up</code> - Supposed to clean up the resources, called once.</li> <li><code>prepare</code> - Called once with the text of the SQL query. For servers that support explicit query preparation, this is the @@ -295,24 +299,24 @@ operations).</li> <li><code>fetch</code> - Called to fetch next bunch of rows; number is positive and determines the requested number of rows (more than 1 is used only for bulk operations).</li> - <li><code>getNumberOfRows</code> - Called to determine the actual + <li><code>get_number_of_rows</code> - Called to determine the actual number of rows retrieved by the previous call to <code>execute</code> or <code>fetch</code>.</li> - <li><code>rewriteForProcedureCall</code> - Used when the <code>Procedure</code> -is used instead of <code>Statement</code>, to call the stored + <li><code>rewrite_for_procedure_call</code> - Used when the <code>procedure</code> +is used instead of <code>statement</code>, to call the stored procedure. This function should rewrite the SQL query (if necessary) to the form that will allow to execute the given procedure. </li> - <li><code>prepareForDescribe</code> - Called once when the <code>into</code> -element is used with the <code>Row</code> type, which means that + <li><code>prepare_for_describe</code> - Called once when the <code>into</code> +element is used with the <code>row</code> type, which means that dynamic rowset description should be performed. It is supposed to do whatever is needed to later describe the column properties and should return the number of columns.</li> - <li><code>describeColumn</code> - Called once for each column (column + <li><code>describe_column</code> - Called once for each column (column numbers - <code>colNum</code> - start from 1), should fill its parameters according to the column properties.</li> - <li><code>makeIntoTypeBackEnd</code>, <code>makeUseTypeBackEnd</code>, - <code>makeVectorIntoTypeBackEnd</code>, <code>makeVectorUseTypeBackEnd</code> + <li><code>make_into_type_backend</code>, <code>make_use_type_backend</code>, + <code>make_vector_into_type_backend</code>, <code>make_vector_use_type_backend</code> - Called once for each <code>into</code> or <code>use</code> element, to create the objects of appropriate classes (described above).</li> </ul> @@ -323,110 +327,126 @@ to create the objects of appropriate classes (described above).</li> is prepared, the <code>alloc</code>, <code>prepare</code> and <code>execute</code> functions are always called, in this order.</li> <li>All <code>into</code> and <code>use</code> elements are bound -(their <code>defineByPos</code> or <code>bindByPos</code>/<code>bindByName</code> +(their <code>define_by_pos</code> or <code>bind_by_pos</code>/<code>bind_by_name</code> functions are called) <i>between</i> statement preparation and execution. </li> </ol> <pre class="example"> -class RowIDBackEnd +class rowid_backend { public: - virtual ~RowIDBackEnd() {} + virtual ~rowid_backend() {} }; </pre> -<p>The <code>RowIDBackEnd</code> class is a hook for the backends to +<p>The <code>rowid_backend</code> class is a hook for the backends to provide their own state for the row identifier. It has no functions, since the only portable interaction with the row identifier object is to use it with <code>into</code> and <code>use</code> elements.</p> <pre class="example"> -class BLOBBackEnd +class blob_backend { public: - virtual ~BLOBBackEnd() {} + virtual ~blob_backend() {} - virtual std::size_t getLen() = 0; - virtual std::size_t read(std::size_t offset, char *buf, + virtual std::size_t get_len() = 0; + virtual std::size_t read(std::size_t offset, char * buf, std::size_t toRead) = 0; - virtual std::size_t write(std::size_t offset, char const *buf, + virtual std::size_t write(std::size_t offset, char const * buf, std::size_t toWrite) = 0; - virtual std::size_t append(char const *buf, std::size_t toWrite) = 0; + virtual std::size_t append(char const * buf, std::size_t toWrite) = 0; virtual void trim(std::size_t newLen) = 0; }; </pre> -<p>The <code>BLOBBackEnd</code> interface provides the entry points for -the <code>BLOB</code> methods.</p> +<p>The <code>blob_backend</code> interface provides the entry points for +the <code>blob</code> methods.</p> <pre class="example"> -class SessionBackEnd +class session_backend { public: - virtual ~SessionBackEnd() {} + virtual ~session_backend() {} virtual void begin() = 0; virtual void commit() = 0; virtual void rollback() = 0; - virtual StatementBackEnd * makeStatementBackEnd() = 0; - virtual RowIDBackEnd * makeRowIDBackEnd() = 0; - virtual BLOBBackEnd * makeBLOBBackEnd() = 0; + virtual std::string get_backend_name() const = 0; + + virtual statement_backend * make_statement_backend() = 0; + virtual rowid_backend * make_rowid_backend() = 0; + virtual blob_backend * make_blob_backend() = 0; }; </pre> -<p>The object of the class derived from SessionBackEnd implements the -internals of the Session object.</p> +<p>The object of the class derived from <code>session_backend</code> implements the +internals of the <code>session</code> object.</p> <ul> <li><code>begin</code>, <code>commit</code>, <code>rollback</code> -- Forward-called when the same functions of <code>Session</code> are +- Forward-called when the same functions of <code>session</code> are called by user.</li> - <li><code>makeStatementBackEnd</code>, <code>makeRowIDBackEnd</code>, - <code>makeBLOBBackEnd</code> - Called to create respective -implementations for the <code>Statement</code>, <code>RowID</code> -and <code>BLOB</code> classes. + <li><code>make_statement_backend</code>, <code>make_rowid_backend</code>, + <code>make_blob_backend</code> - Called to create respective +implementations for the <code>statement</code>, <code>rowid</code> +and <code>blob</code> classes. </li> </ul> <pre class="example"> -struct BackEndFactory +struct backend_factory { - virtual SessionBackEnd * makeSession( - std::string const &connectString) const = 0; + virtual ~backend_factory() {} + + virtual details::session_backend * make_session( + std::string const & connectString) const = 0; }; </pre> -<p>The <code>BackEndFactory</code> is a base class for backend-provided +<p>The <code>backend_factory</code> is a base class for backend-provided factory class that is able to create valid sessions. The <code>connectString</code> -parameter passed to <code>makeSession</code> is provided here by the <code>Session</code> -constructor.</p> +parameter passed to <code>make_session</code> is provided here by the <code>session</code> +constructor and contains only the backend-related parameters, without the backend name +(if the dynamic backend loading is used).</p> <p>The actual backend factory object is supposed to be provided by the -backend implementation and declared in its header file.</p> +backend implementation and declared in its header file. In addition to this, +the <code>factory_ABC</code> function with the "C" calling convention +and returning the pointer to concrete factory object should be provided, +where <code>ABC</code> is the backend name.</p> <p>The following example is taken from <code>soci-postgresql.h</code>, which declares entities of the PostgreSQL backend:</p> <pre class="example"> -// concrete backend factory for PostgreSQL -struct PostgreSQLBackEndFactory : BackEndFactory +struct postgresql_backend_factory : backend_factory { - virtual PostgreSQLSessionBackEnd * makeSession( - std::string const &connectString) const; + virtual postgresql_session_backend * make_session( + std::string const & connectString) const; }; -// globally visible factory object -extern PostgreSQLBackEndFactory const postgresql; +extern postgresql_backend_factory const postgresql; + +extern "C" +{ + +// for dynamic backend loading +backend_factory const * factory_postgresql(); + +} // extern "C" </pre> <p>With the above declarations, it is enough to pass the <code>postgresql</code> -factory name to the constructor of the <code>Session</code> object, +factory name to the constructor of the <code>session</code> object, which will use this factory to create concrete implementations for any other objects that -are needed, with the help of appropriate <code>makeXYZ</code> -functions.</p> +are needed, with the help of appropriate <code>make_XYZ</code> +functions. Alternatively, the <code>factory_postgresql</code> function will +be called automatically by the backend loader if the backend name is provided +at run-time instead.</p> <p>Note that the backend source code is placed in the <code>backends/<i>name</i></code> directory (for example, <code>backends/oracle</code>) and the test driver is in <code>backends/<i>name</i>/test</code>. There is also <code>backends/empty</code> diff --git a/doc/backends/firebird.html b/doc/backends/firebird.html index 4ea2617b..c1deafb2 100644 --- a/doc/backends/firebird.html +++ b/doc/backends/firebird.html @@ -67,6 +67,13 @@ using the firebird backend factory together with a connection string:</p> <pre class="example"> BackEndFactory const &backEnd = firebird; +Session sql(backEnd, + "service=/usr/local/firbird/db/test.fdb user=SYSDBA password=masterkey"); +</pre> + +<p>or simply:</p> + +<pre class="example"> Session sql(firebird, "service=/usr/local/firbird/db/test.fdb user=SYSDBA password=masterkey"); </pre> diff --git a/doc/backends/index.html b/doc/backends/index.html index 447e5833..383d95c0 100644 --- a/doc/backends/index.html +++ b/doc/backends/index.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="../style.css" /> @@ -109,7 +109,7 @@ </td> </tr> </table> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/backends/mysql.html b/doc/backends/mysql.html index 63e5f4a6..2f0bd82c 100644 --- a/doc/backends/mysql.html +++ b/doc/backends/mysql.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="../style.css" /> @@ -40,7 +40,7 @@ <h4 id="versions">Supported Versions</h4> <p>The SOCI MySQL backend should in principle work with every version -of MySQL 3.x or newer. Some of features (transactions, stored +of MySQL 3.x or newer. Some of the features (transactions, stored functions) are not available when MySQL server doesn't support them.</p> <h4 id="tested">Tested Platforms</h4> @@ -48,88 +48,92 @@ functions) are not available when MySQL server doesn't support them.</p> <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr><th>MySQL version</th><th>Operating System</th><th>Compiler</th></tr> -<tr><td>4.1.20</td><td>Linux i686 2.6.17 (Fedora Core release 4)</td><td>g++ 4.0.2</td></tr> -<tr><td>5.0.22</td><td>Linux i686 2.6.15 (Ubuntu 6.06)</td><td>g++ 4.0.3</td></tr> -<tr><td>5.0.18</td><td>Mac OS X 10.4</td><td>g++ 4.0.0</td></tr> -<tr><td>4.0.22</td><td>Linux i686 2.6.10-gentoo-r6</td><td>g++ 3.4.5</td></tr> +<tr><td>5.0.45</td><td>Linux i686 2.6.23 (Fedora release 7)</td><td>g++ 4.1.2</td></tr> </tbody> </table> -<p>One other version of MySQL server that has been tested -is 3.23.57.</p> - <h4 id="required">Required Client Libraries</h4> <p>The SOCI MySQL backend requires MySQL's <code>libmysqlclient</code> client library.</p> +<p>Note that the SOCI library itself depends also on <code>libdl</code>, so the minimum set of libraries needed to compile a basic client program is:</p> +<pre class="example"> +-lsoci_core -lsoci_mysql -ldl -lmysqlclient +</pre> + <h4 id="connecting">Connecting to the Database</h4> -<p>To establish a connection to a MySQL server, create a Session object +<p>To establish a connection to a MySQL server, create a <code>session</code> object using the <code>mysql</code> backend factory together with a connection string:</p> <pre class="example"> -BackEndFactory const &backEnd = mysql; -Session sql(backEnd, "db=test user=root password='Ala ma kota'"); +session sql(mysql, "db=test user=root password='Ala ma kota'"); + +// or: +session sql("mysql", "db=test user=root password='Ala ma kota'"); + +// or: +session sql("mysql://db=test user=root password='Ala ma kota'"); </pre> <p>The set of parameters used in the connection string for MySQL is:</p> <ul> - <li>dbname or db (required)</li> - <li>user</li> - <li>password or pass</li> - <li>host</li> - <li>port</li> - <li>unix_socket</li> + <li><code>dbname</code> or <code>db</code> (required)</li> + <li><code>user</code></li> + <li><code>password</code> or <code>pass</code></li> + <li><code>host</code></li> + <li><code>port</code></li> + <li><code>unix_socket</code></li> </ul> -<p>Once you have created a <code>Session</code> object as shown above, you +<p>Once you have created a <code>session</code> object as shown above, you can use it to access the database, for example:</p> <pre class="example"> int count; sql << "select count(*) from invoices", into(count); </pre> -<p>(See the <a href="../basics.html">SOCI basics</a> and <a href="../exchange.html">exchanging data</a> documentation for general information on using the <code>Session</code> class.)</p> +<p>(See the <a href="../basics.html">SOCI basics</a> and <a href="../exchange.html">exchanging data</a> documentation for general information on using the <code>session</code> class.)</p> <h3 id="support">SOCI Feature Support</h3> <h4 id="dynamic">Dynamic Binding</h4> -<p>The MySQL backend supports the use of the SOCI <code>Row</code> class, -which facilitates retrieval of data whose type is not known at compile +<p>The MySQL backend supports the use of the SOCI <code>row</code> class, +which facilitates retrieval of data which type is not known at compile time.</p> -<p>When calling <code>Row::get<T>()</code>, the type you should pass -as T depends upon the underlying database type.<br/> +<p>When calling <code>row::get<T>()</code>, the type you should pass +as <code>T</code> depends upon the underlying database type.<br/> For the MySQL backend, this type mapping is:</p> <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr> - <th>PostgreSQL Data Type</th> + <th>MySQL Data Type</th> <th>SOCI Data Type</th> - <th><code>Row::get<T></code> specializations</th> + <th><code>row::get<T></code> specializations</th> </tr> <tr> <td>FLOAT, DOUBLE, DECIMAL and synonyms</td> - <td><code>eDouble</code></td> + <td><code>dt_double</code></td> <td><code>double</code></td> </tr> <tr> <td>TINYINT, SMALLINT, INT, BIGINT (provided it's in the range)</td> - <td><code>eInteger</code></td> + <td><code>dt_integer</code></td> <td><code>int</code></td> </tr> <tr> <td>STRING/BINARY, VARCHAR/VARBINARY</td> - <td><code>eString</code></td> + <td><code>dt_string</code></td> <td><code>std::string</code></td> </tr> <tr> <td>TIMESTAMP (works only with MySQL >= 5.0), DATE, TIME, DATETIME</td> - <td><code>eDate</code></td> + <td><code>dt_date</code></td> <td><code>std::tm</code><code></code></td> </tr> </tbody> @@ -170,11 +174,11 @@ and only with appropriate table types. <h4 id="blob">BLOB Data Type</h4> -<p>SOCI BLOB interface is not supported by the MySQL backend.</p> +<p>SOCI <code>blob</code> interface is not supported by the MySQL backend.</p> <h4 id="rowid">RowID Data Type</h4> -<p>RowID is not supported by the MySQL backend.</p> +<p>The <code>rowid</code> functionality is not supported by the MySQL backend.</p> <h4 id="nested">Nested Statements</h4> @@ -187,12 +191,12 @@ stored routines: stored procedures and stored functions (for details, please consult the <a href="http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html">MySQL documentation</a>). Stored functions can be executed by using -SOCI's <a href="../statements.html#procedures">Procedure</a> class. +SOCI's <a href="../statements.html#procedures">procedure</a> class. There is currently no support for stored procedures.</p> <h3 id="native">Acessing the native database API</h3> -<p>SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the <a href="../beyond.html">beyond SOCI</a> documentation.</p> +<p>SOCI provides access to underlying datbabase APIs via several <code>get_backend()</code> functions, as described in the <a href="../beyond.html">Beyond SOCI</a> documentation.</p> <p>The MySQL backend provides the following concrete classes for native API access:</p> @@ -203,12 +207,12 @@ There is currently no support for stored procedures.</p> <th>Concrete Class</th> </tr> <tr> - <td><code>SessionBackEnd* Session::getBackEnd()</code></td> - <td><code>MySQLSessionBackEnd</code></td> + <td><code>session_backend * session::get_backend()</code></td> + <td><code>mysql_session_backend</code></td> </tr> <tr> - <td><code>StatementBackEnd* Statement::getBackEnd()</code></td> - <td><code>MySQLStatementBackEnd</code></td> + <td><code>statement_backend * statement::get_backend()</code></td> + <td><code>mysql_statement_backend</code></td> </tr> </tbody> </table> @@ -222,6 +226,6 @@ There is currently no support for stored procedures.</p> <p>None.</p> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton, Pawel Aleksander Fedorynski</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton, Pawel Aleksander Fedorynski</p> </body> </html> diff --git a/doc/backends/odbc.html b/doc/backends/odbc.html index f423b2ee..6f63ed39 100644 --- a/doc/backends/odbc.html +++ b/doc/backends/odbc.html @@ -69,6 +69,12 @@ BackEndFactory const &backEnd = odbc; Session sql(backEnd, "filedsn=c:\\my.dsn"); </pre> +<p>or simply:</p> + +<pre class="example"> +Session sql(odbc, "filedsn=c:\\my.dsn"); +</pre> + <p>The set of parameters used in the connection string for ODBC is the same as accepted by the <code><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbcsql/od_odbc_d_4x4k.asp">SQLDriverConnect</a></code> function from the ODBC library.</p> <p>Once you have created a <code>Session</code> object as shown above, you can use it to access the database, for example:</p> diff --git a/doc/backends/oracle.html b/doc/backends/oracle.html index 50c80fcd..faa46110 100644 --- a/doc/backends/oracle.html +++ b/doc/backends/oracle.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="../style.css" /> @@ -34,14 +34,14 @@ <a href="#native">Accessing the Native Database API</a><br /> <a href="#extensions">Backend-specific Extensions</a><br /> <div class="navigation-indented"> - <a href="#oracle_soci_error">OracleSOCIError</a><br /> + <a href="#oracle_soci_error">oracle_soci_error</a><br /> </div> </div> <h3 id="prerequisites">Prerequisites</h3> <h4 id="versions">Supported Versions</h4> -<p>The SOCI Oracle backend is currently supported for use with Oracle 10g.<br /> +<p>The SOCI Oracle backend is currently supported for use with Oracle 10 or later.<br /> Older versions of Oracle may work as well, but they have not been tested by the SOCI team.</p> <h4 id="tested">Tested Platforms</h4> @@ -49,85 +49,101 @@ Older versions of Oracle may work as well, but they have not been tested by the <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr><th>Oracle version</th><th>Operating System</th><th>Compiler</th></tr> -<tr><td>10.1.0</td><td>Linux i686 2.6.10-gentoo-r6</td><td>g++ 3.4.5</td></tr> -<tr><td>10.1.0</td><td>Linux i686 2.4.21 (RedHat family)</td><td>g++ 3.2.3</td></tr> -<tr><td>10.2.0</td><td>Windows XP</td><td>Visual C++ 8.0 Professional</td></tr> +<tr><td>10.2.0 (XE)</td><td>Linux i686 2.6.9 (RedHat family)</td><td>g++ 3.4.6</td></tr> </tbody> </table> <h4 id="required">Required Client Libraries</h4> -<p>The SOCI Oracle backend requires Oracle's <code>libclntsh</code> client library.</p> +<p>The SOCI Oracle backend requires Oracle's <code>libclntsh</code> client library. +Depending on the particular system, the <code>libnnz10</code> library might be needed as well.</p> +<p>Note that the SOCI library itself depends also on <code>libdl</code>, so the minimum set of libraries needed to compile a basic client program is:</p> +<pre class="example"> +-lsoci_core -lsoci_oracle -ldl -lclntsh -lnnz10 +</pre> <h4 id="connecting">Connecting to the Database</h4> -<p>To establish a connection to an Oracle database, create a Session object +<p>To establish a connection to an Oracle database, create a <code>session</code> object using the oracle backend factory together with a connection string:</p> <pre class="example"> -BackEndFactory const &backEnd = oracle; -Session sql(oracle, "service=orcl user=scott password=tiger"); +session sql(oracle, "service=orcl user=scott password=tiger"); + +// or: +session sql("oracle", "service=orcl user=scott password=tiger"); + +// or: +session sql("oracle://service=orcl user=scott password=tiger"); </pre> <p>The set of parameters used in the connection string for Oracle is:</p> <ul> - <li>service</li> - <li>user</li> - <li>password</li> + <li><code>service</code></li> + <li><code>user</code></li> + <li><code>password</code></li> + <li><code>mode</code> (optional)</li> +</ul> +<p>The first 3 of these parameters have to be provided as part of the connection string.</p> +<p>The <code>mode</code> parameter allows to specify the connection mode and can be any of:</p> +<ul> + <li><code>default</code> (which is assumed if omitted)</li> + <li><code>sysdba</code></li> + <li><code>sysoper</code></li> </ul> -<p>All 3 of these parameters have to be provided as part of the connection string.</p> -<p>Once you have created a <code>Session</code> object as shown above, you can use it to access the database, for example:</p> +<p>Once you have created a <code>session</code> object as shown above, you can use it to access the database, for example:</p> <pre class="example"> int count; sql << "select count(*) from user_tables", into(count); </pre> -<p>(See the <a href="../basics.html">SOCI basics</a> and <a href="../exchange.html">exchanging data</a> documentation for general information on using the <code>Session</code> class.)</p> +<p>(See the <a href="../basics.html">SOCI basics</a> and <a href="../exchange.html">exchanging data</a> documentation for general information on using the <code>session</code> class.)</p> <h3 id="support">SOCI Feature Support</h3> + <h4 id="dynamic">Dynamic Binding</h4> -<p>The Oracle backend supports the use of the SOCI <code>Row</code> class, which facilitates retrieval of data whose type is not known at compile time.</p> +<p>The Oracle backend supports the use of the SOCI <code>row</code> class, which facilitates retrieval of data which type is not known at compile time.</p> -<p>When calling <code>Row::get<T>()</code>, the type you should pass as T depends upon the underlying database type.<br/> For the Oracle backend, this type mapping is:</p> +<p>When calling <code>row::get<T>()</code>, the type you should pass as <code>T</code> depends upon the underlying database type.<br/> For the Oracle backend, this type mapping is:</p> <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr> <th>Oracle Data Type</th> <th>SOCI Data Type</th> - <th><code>Row::get<T></code> specializations</th> + <th><code>row::get<T></code> specializations</th> </tr> <tr> <td>number <i>(where scale > 0)</i></td> - <td><code>eDouble</code></td> + <td><code>dt_double</code></td> <td><code>double</code></td> </tr> <tr> <td>number<br /><i>(where scale = 0 and precision < std::numeric_limits<int>::digits10)</i></td> - <td><code>eInteger</code></td> + <td><code>dt_integer</code></td> <td><code>int</code></td> </tr> <tr> <td>number</td> - <td><code>eUnsignedLong</code></td> - <td><code>unsigned long</code></td> + <td><code>dt_long_long</code></td> + <td><code>long long</code></td> </tr> <tr> <td>char, varchar, varchar2</td> - <td><code>eString</code></td> + <td><code>dt_string</code></td> <td><code>std::string</code></td> </tr> <tr> <td>date</td> - <td><code>eDate</code></td> + <td><code>dt_date</code></td> <td><code>std::tm</code><code></code></td> </tr> </tbody> </table> -<p>(See the <a href="../exchange.html#dynamic">dynamic resultset binding</a> documentation for general information on using the <code>Row</code> class.)</p> +<p>(See the <a href="../exchange.html#dynamic">dynamic resultset binding</a> documentation for general information on using the <code>row</code> class.)</p> <h4 id="bindingbyname">Binding by Name</h4> @@ -146,41 +162,44 @@ sql << "select name from person where id = :id", use(id, "id") <h4 id="transactions">Transactions</h4> -<p><a href="../statements.html#transactions">Transactions</a> are also fully supported by the Oracle backend.</p> +<p><a href="../statements.html#transactions">Transactions</a> are also fully supported by the Oracle backend, +although transactions with non-default isolation levels have to be managed by explicit SQL statements.</p> -<h4 id="blob">BLOB Data Type</h4> +<h4 id="blob">blob Data Type</h4> -<p>The Oracle backend supports working with data stored in columns of type Blob, via SOCI's <a href="../exchange.html#blob"><code>BLOB</code></a> class.</p> +<p>The Oracle backend supports working with data stored in columns of type Blob, via SOCI's <a href="../exchange.html#blob"><code>blob</code></a> class.</p> -<h4 id="rowid">RowID Data Type</h4> +<h4 id="rowid">rowid Data Type</h4> -<p>Oracle rowid's are accessible via SOCI's <a href="../reference.html#rowid"><code>RowID</code></a> class.</p> +<p>Oracle rowid's are accessible via SOCI's <a href="../reference.html#rowid"><code>rowid</code></a> class.</p> <h4 id="nested">Nested Statements</h4> -<p>The Oracle backend supports selecting into objects of type <code>Statement</code>, so that you may work with nested sql statements and PL/SQL cursors:</p> +<p>The Oracle backend supports selecting into objects of type <code>statement</code>, so that you may work with nested sql statements and PL/SQL cursors:</p> <pre class="example"> -Statement stInner(sql); -Statement stOuter = (sql.prepare << - "select cursor(select name from person order by id)" - " from person where id = 1", - into(stInner)); +statement stInner(sql); +statement stOuter = (sql.prepare << + "select cursor(select name from person order by id)" + " from person where id = 1", + into(stInner)); stInner.exchange(into(name)); stOuter.execute(); stOuter.fetch(); while (stInner.fetch()) - std::cout << name << '\n'; +{ + std::cout << name << '\n'; +} </pre> <h4 id="procedures">Stored Procedures</h4> -<p>Oracle stored procedures can be executed by using SOCI's <a href="../statements.html#procedures"><code>Procedure</code></a> class.</p> +<p>Oracle stored procedures can be executed by using SOCI's <a href="../statements.html#procedures"><code>procedure</code></a> class.</p> <h3 id="native">Acessing the native database API</h3> -<p>SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the <a href="../beyond.html">beyond SOCI</a> documentation.</p> +<p>SOCI provides access to underlying datbabase APIs via several <code>get_backend()</code> functions, as described in the <a href="../beyond.html">Beyond SOCI</a> documentation.</p> <p>The Oracle backend provides the following concrete classes for navite API access:</p> @@ -191,31 +210,31 @@ while (stInner.fetch()) <th>Concrete Class</th> </tr> <tr> - <td><code>SessionBackEnd* Session::getBackEnd()</code></td> - <td><code>OracleSessionBackEnd</code></td> + <td><code>session_backend * session::get_backend()</code></td> + <td><code>oracle_session_backend</code></td> </tr> <tr> - <td><code>StatementBackEnd* Statement::getBackEnd()</code></td> - <td><code>OracleStatementBackEnd</code></td> + <td><code>statement_backend * statement::get_backend()</code></td> + <td><code>oracle_statement_backend</code></td> </tr> <tr> - <td><code>BLOBBackEnd* BLOB::getBackEnd()</code></td> - <td><code>OracleBLOBBackEnd</code></td> + <td><code>blob_backend * blob::get_backend()</code></td> + <td><code>oracle_blob_backend</code></td> </tr> <tr> - <td><code>RowIDBackEnd* RowID::getBackEnd()</code></td> - <td><code>OracleRowIDBackEnd</code></td> + <td><code>rowid_backend * rowid::get_backend()</code></td> + <td><code>oracle_rowid_backend</code></td> </tr> </tbody> </table> <h3 id="extensions">Backend-specific extensions</h3> -<h4 id="oracle_soci_error">OracleSOCIError</h4> +<h4 id="oracle_soci_error">eracle=soci_error</h4> -<p>The Oracle backend can throw instances of class <code>OracleSOCIError</code>, -which is publicly derived from <code>SOCIError</code> and has an -additional public <code>errNum_</code> member containing the Oracle error code:</p> +<p>The Oracle backend can throw instances of class <code>oracle_soci_error</code>, +which is publicly derived from <code>soci_error</code> and has an +additional public <code>err_num_</code> member containing the Oracle error code:</p> <pre class="example"> int main() @@ -224,9 +243,9 @@ int main() { // regular code } - catch (OracleSOCIError const &e) + catch (oracle_soci_error const & e) { - cerr << "Oracle error: " << e.errNum_ + cerr << "Oracle error: " << e.err_num_ << " " << e.what() << endl; } catch (exception const &e) @@ -236,6 +255,6 @@ int main() } </pre> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/backends/postgresql.html b/doc/backends/postgresql.html index 738664d7..f30123a2 100644 --- a/doc/backends/postgresql.html +++ b/doc/backends/postgresql.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="../style.css" /> @@ -46,81 +46,96 @@ <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr><th>PostgreSQL version</th><th>Operating System</th><th>Compiler</th></tr> -<tr><td>8.1</td><td>FreeBSD 6.1</td><td>g++ 3.4.4</td></tr> -<tr><td>7.3</td><td>Linux i686 2.4.21 (RedHat type)</td><td>g++ 3.2.3</td></tr> -<tr><td>8.0.4</td><td>Linux i686 2.6.10-gentoo-r6</td><td>g++ 3.4.5</td></tr> -<tr><td>8.1.5</td><td>Windows XP</td><td>Visual C++ 8.0 Professional</td></tr> -<tr><td>8.2rc1</td><td>Windows XP</td><td>Visual C++ 8.0 Professional</td></tr> +<tr><td>8.3</td><td>Mac OS X 10.5.3</td><td>g++ 4.0.1</td></tr> +<tr><td>8.3</td><td>Mac OS X 10.5.3</td><td>g++ 4.4.0</td></tr> +<tr><td>8.3</td><td>FreeBSD 7.0</td><td>g++ 4.2.1</td></tr> +<tr><td>8.3</td><td>Linux i686 2.6.9 (RedHat family)</td><td>g++ 3.4.6</td></tr> +<tr><td>8.2.7</td><td>Linux i686 2.6.23 (Fedora release 7)</td><td>g++ 4.1.2</td></tr> </tbody> </table> <h4 id="required">Required Client Libraries</h4> <p>The SOCI PostgreSQL backend requires PostgreSQL's <code>libpq</code> client library.</p> +<p>Note that the SOCI library itself depends also on <code>libdl</code>, so the minimum set of libraries needed to compile a basic client program is:</p> +<pre class="example"> +-lsoci_core -lsoci_postgresql -ldl -lpq +</pre> <h4 id="connecting">Connecting to the Database</h4> -<p>To establish a connection to the PostgreSQL database, create a Session object +<p>To establish a connection to the PostgreSQL database, create a <code>session</code> object using the <code>postgresql</code> backend factory together with a connection string:</p> <pre class="example"> -BackEndFactory const &backEnd = postgresql; -Session sql(postgresql, "dbname=mydatabase"); +session sql(postgresql, "dbname=mydatabase"); + +// or: +session sql("postgresql", "dbname=mydatabase"); + +// or: +session sql("postgresql://dbname=mydatabase"); </pre> -<p>The set of parameters used in the connection string for PostgreSQL is the same as accepted by the <code><a href="http://www.postgresql.org/docs/8.1/interactive/libpq.html#LIBPQ-CONNECT">PQconnectdb</a></code> function from the <code>libpq</code> library.</p> +<p>The set of parameters used in the connection string for PostgreSQL is the same as accepted by the <code><a href="http://www.postgresql.org/docs/8.3/interactive/libpq.html#LIBPQ-CONNECT">PQconnectdb</a></code> function from the <code>libpq</code> library.</p> -<p>Once you have created a <code>Session</code> object as shown above, you can use it to access the database, for example:</p> +<p>Once you have created a <code>session</code> object as shown above, you can use it to access the database, for example:</p> <pre class="example"> int count; sql << "select count(*) from invoices", into(count); </pre> -<p>(See the <a href="../basics.html">SOCI basics</a> and <a href="../exchange.html">exchanging data</a> documentation for general information on using the <code>Session</code> class.)</p> +<p>(See the <a href="../basics.html">SOCI basics</a> and <a href="../exchange.html">exchanging data</a> documentation for general information on using the <code>session</code> class.)</p> <h3 id="support">SOCI Feature Support</h3> + <h4 id="dynamic">Dynamic Binding</h4> -<p>The PostgreSQL backend supports the use of the SOCI <code>Row</code> class, which facilitates retrieval of data whose type is not known at compile time.</p> +<p>The PostgreSQL backend supports the use of the SOCI <code>row</code> class, which facilitates retrieval of data whose type is not known at compile time.</p> -<p>When calling <code>Row::get<T>()</code>, the type you should pass as T depends upon the underlying database type.<br/> For the PostgreSQL backend, this type mapping is:</p> +<p>When calling <code>row::get<T>()</code>, the type you should pass as <code>T</code> depends upon the underlying database type.<br/> For the PostgreSQL backend, this type mapping is:</p> <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr> <th>PostgreSQL Data Type</th> <th>SOCI Data Type</th> - <th><code>Row::get<T></code> specializations</th> + <th><code>row::get<T></code> specializations</th> </tr> <tr> <td>numeric, real, double</td> - <td><code>eDouble</code></td> + <td><code>dt_double</code></td> <td><code>double</code></td> </tr> <tr> - <td>boolean, smallint, integer, bigint (provided it's in the range)</td> - <td><code>eInteger</code></td> + <td>boolean, smallint, integer</td> + <td><code>dt_integer</code></td> <td><code>int</code></td> </tr> + <tr> + <td>int8</td> + <td><code>dt_long_long</code></td> + <td><code>long long</code></td> + </tr> <tr> <td>oid</td> - <td><code>eUnsignedLong</code></td> + <td><code>dt_unsigned_long</code></td> <td><code>unsigned long</code></td> </tr> <tr> <td>char, varchar, text, cstring, bpchar</td> - <td><code>eString</code></td> + <td><code>dt_string</code></td> <td><code>std::string</code></td> </tr> <tr> <td>abstime, reltime, date, time, timestamp, timestamptz, timetz</td> - <td><code>eDate</code></td> + <td><code>dt_date</code></td> <td><code>std::tm</code><code></code></td> </tr> </tbody> </table> -<p>(See the <a href="../exchange.html#dynamic">dynamic resultset binding</a> documentation for general information on using the <code>Row</code> class.)</p> +<p>(See the <a href="../exchange.html#dynamic">dynamic resultset binding</a> documentation for general information on using the <code>row</code> class.)</p> <h4 id="bindingbyname">Binding by Name</h4> @@ -149,13 +164,13 @@ sql << "insert into t(x, y) values($1, $2)", use(i), use(j); <p><a href="../statements.html#transactions">Transactions</a> are also fully supported by the PostgreSQL backend.</p> -<h4 id="blob">BLOB Data Type</h4> +<h4 id="blob">blob Data Type</h4> -<p>The PostgreSQL backend supports working with data stored in columns of type Blob, via SOCI's <a href="../exchange.html#blob"><code>BLOB</code></a> class with the exception that trimming is not supported.</p> +<p>The PostgreSQL backend supports working with data stored in columns of type Blob, via SOCI's <a href="../exchange.html#blob"><code>blob</code></a> class with the exception that trimming is not supported.</p> -<h4 id="rowid">RowID Data Type</h4> +<h4 id="rowid">rowid Data Type</h4> -<p>The concept of row identifier (OID in PostgreSQL) is supported via SOCI's <a href="../reference.html#rowid">RowID</a> class.</p> +<p>The concept of row identifier (OID in PostgreSQL) is supported via SOCI's <a href="../reference.html#rowid">rowid</a> class.</p> <h4 id="nested">Nested Statements</h4> @@ -163,11 +178,11 @@ sql << "insert into t(x, y) values($1, $2)", use(i), use(j); <h4 id="procedures">Stored Procedures</h4> -<p>PostgreSQL stored procedures can be executed by using SOCI's <a href="../statements.html#procedures">Procedure</a> class.</p> +<p>PostgreSQL stored procedures can be executed by using SOCI's <a href="../statements.html#procedures">procedure</a> class.</p> <h3 id="native">Acessing the native database API</h3> -<p>SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the <a href="../beyond.html">beyond SOCI</a> documentation.</p> +<p>SOCI provides access to underlying datbabase APIs via several <code>get_backend()</code> functions, as described in the <a href="../beyond.html">beyond SOCI</a> documentation.</p> <p>The PostgreSQL backend provides the following concrete classes for navite API access:</p> @@ -178,20 +193,20 @@ sql << "insert into t(x, y) values($1, $2)", use(i), use(j); <th>Concrete Class</th> </tr> <tr> - <td><code>SessionBackEnd* Session::getBackEnd()</code></td> - <td><code>PostgreSQLSessionBackEnd</code></td> + <td><code>session_backend * session::get_backend()</code></td> + <td><code>postgresql_session_backend</code></td> </tr> <tr> - <td><code>StatementBackEnd* Statement::getBackEnd()</code></td> - <td><code>PostgreSQLStatementBackEnd</code></td> + <td><code>statement_backend * statement::get_backend()</code></td> + <td><code>postgresql_statement_backend</code></td> </tr> <tr> - <td><code>BLOBBackEnd* BLOB::getBackEnd()</code></td> - <td><code>PostgreSQLBLOBBackEnd</code></td> + <td><code>blob_backend * blob::get_backend()</code></td> + <td><code>postgresql_blob_backend</code></td> </tr> <tr> - <td><code>RowIDBackEnd* RowID::getBackEnd()</code></td> - <td><code>PostgreSQLRowIDBackEnd</code></td> + <td><code>rowid_backend * rowid::get_backend()</code></td> + <td><code>postgresql_rowid_backend</code></td> </tr> </tbody> </table> @@ -211,6 +226,6 @@ sql << "insert into t(x, y) values($1, $2)", use(i), use(j); </ul> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/backends/sqlite3.html b/doc/backends/sqlite3.html index 7082dc01..0e86a9d3 100644 --- a/doc/backends/sqlite3.html +++ b/doc/backends/sqlite3.html @@ -47,11 +47,13 @@ <tbody> <tr><th>SQLite3 version</th><th>Operating System</th><th>Compiler</th></tr> <tr><td>3.1.3</td><td>Mac OS X 10.4</td><td>g++ 4.0.1</td></tr> +<tr><td>3.2.1</td><td>Linux i686 2.6.10-gentoo-r6</td><td>g++ 3.4.5</td></tr> <tr><td>3.3.4</td><td>Ubuntu 5.1</td><td>g++ 4.0.2</td></tr> <tr><td>3.3.4</td><td>Windows XP</td><td>(cygwin) g++ 3.3.4</td></tr> <tr><td>3.3.4</td><td>Windows XP</td><td>Visual C++ 2005 Express Edition</td></tr> <tr><td>3.3.8</td><td>Windows XP</td><td>Visual C++ 2005 Professional</td></tr> -<tr><td>3.2.1</td><td>Linux i686 2.6.10-gentoo-r6</td><td>g++ 3.4.5</td></tr> +<tr><td>3.4.0</td><td>Windows XP</td><td>(cygwin) g++ 3.4.4</td></tr> +<tr><td>3.4.0</td><td>Windows XP</td><td>Visual C++ 2005 Express Edition</td></tr> </tbody> </table> @@ -69,6 +71,12 @@ BackEndFactory const &backEnd = SQLite3; Session sql(backEnd, "database_filename"); </pre> +<p>or simply:</p> + +<pre class="example"> +Session sql(SQLite3, "database_filename"); +</pre> + <p>The only option for the connection string is the name of the file to use as a database.</p> <p>Once you have created a <code>Session</code> object as shown above, you can use it to access the database, for example:</p> diff --git a/doc/basics.html b/doc/basics.html index 1c8f3a2b..70d002ff 100644 --- a/doc/basics.html +++ b/doc/basics.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -13,50 +13,93 @@ <h3>Connecting to the database</h3> -<p>The class <code>Session</code> encapsulates the database connection +<p>The <code>session</code> class encapsulates the database connection and other backend-related details, which are common to all the statements -that will be later executed. Its constructor expects two parameters: +that will be later executed. It has a couple of overloaded constructors.</p> + +<p>The most basic one expects two parameters: the requested backend factory object and the generic connection string, which meaning is backend-dependent.</p> <p>Example:</p> <pre class="example"> -Session sql(oracle, "service=orcl user=scott password=tiger"); +session sql(oracle, "service=orcl user=scott password=tiger"); </pre> <p>Another example might be:</p> <pre class="example"> -Session sql(postgresql, "dbname=mydb"); +session sql(postgresql, "dbname=mydb"); </pre> <p>Above, the <code>sql</code> object is a local (automatic) object that encapsulates the connection.</p> -<p>The <code>Session</code> constructor either connects successfully, or -throws the exception.</p> +<p>This <code>session</code> constructor either connects successfully, or +throws an exception.</p> + +<p>Another constructor allows to name backends at run-time and supports +the dynamically loadable backends, which have to be compiled as shared libraries. The usage is similar to the above, but instead of providing the factory object, the backend name is expected:</p> + +<pre class="example"> +session sql("postgresql", "dbname=mydb"); +</pre> + +<p>For convenience, the URL-like form that combines both the backend name with connection parameters is supported as well:</p> + +<pre class="example"> +session sql("postgresql://dbname=mydb"); +</pre> + +<p>The last two constructors described above try to locate the shared library with the name <code>libsoci_ABC.so</code> (or <code>libsoci_ABC.dll</code> on Windows), where ABC is the backend name. In the above examples, the expected library name will be <code>libsoci_postgresql.so</code> for Unix-like systems.</p> + +<div class="note"> +<p><span class="note">Environment configuration:</span></p> +<p>The <code>SOCI_BACKENDS_PATH</code> environment variable defines the set of paths where the shared libraries will be searched for. There can be many paths, separated by colons, and they are used from left to right until the library with the appropriate name is found. If this variable is not set or is empty, the current directory is used as a default path for dynamically loaded backends.</p> +</div> + +<p>An alternative way to set up the session is to create it in the disconnected state and connect later:</p> + +<pre class="example"> +session sql; + +// some time later: +sql.open(postgresql, "dbname=mydb"); + +// or: +sql.open("postgresql://dbname=mydb"); +</pre> + +<p>The rules for backend naming are the same as with the constructors described above.</p> +<p>The session can be also explicitly <code>close</code>d and <code>reconnect</code>ed, which can help with basic session error recovery. The <code>reconnect</code> function has no parameters and attempts to use the same values as those provided with earlier constructor or <code>open</code> calls.</p> + +<p>See also the page devoted to <a href="multithreading.html">multithreading</a> for a detailed description of connection pools.</p> -<p>It is possible to have many active <code>Session</code>s at the same +<p>It is possible to have many active <code>session</code>s at the same time, even using different backends.</p> <div class="note"> <p><span class="note">Portability note:</span></p> -<p>The following backend factories are currently available:</p> +<p>The following backend factories are currently (as of 3.0.0 release) available:</p> <ul> <li><code><a href="backends/mysql.html">mysql</a></code> (requires <code>#include "soci-mysql.h"</code>)</li> <li><code><a href="backends/oracle.html">oracle</a></code> (requires <code>#include "soci-oracle.h"</code>)</li> <li><code><a href="backends/postgresql.html">postgresql</a></code> (requires <code>#include "soci-postgresql.h"</code>)</li> +</ul> +<p>The following backends are also available, with various levels of completeness:</p> +<ul> <li><code><a href="backends/sqlite3.html">sqlite3</a></code> (requires <code>#include "soci-sqlite3.h"</code>)</li> <li><code><a href="backends/odbc.html">odbc</a></code> (requires <code>#include "soci-odbc.h"</code>)</li> <li><code><a href="backends/firebird.html">firebird</a></code> (requires <code>#include "soci-firebird.h"</code>)</li> </ul> </div> + <h3>Simple SQL statements</h3> <p>In many cases, the SQL query is intended to be executed only once, which means that statement parsing and execution can go together. -The <code>Session</code> class provides a special <code>once</code> +The <code>session</code> class provides a special <code>once</code> member, which triggers parsing and execution of such one-time statements:</p> @@ -95,6 +138,6 @@ sql << "delete from companies where id = " << id; </tr> </table> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/beyond.html b/doc/beyond.html index 5edd0097..3647c5d7 100644 --- a/doc/beyond.html +++ b/doc/beyond.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -29,41 +29,41 @@ client application to get access to all low-level details that are involved.</p> <pre class="example"> -BLOB b(sql); +blob b(sql); -OracleSessionBackEnd *sessionBackEnd = static_cast<OracleSessionBackEnd *>(sql.getBackEnd()); -OracleBLOBBackEnd *blobBackEnd = static_cast<OracleBLOBBackEnd *>(b.getBackEnd()); +oracle_session_back_end * sessionBackEnd = static_cast<oracle_session_back_end *>(sql.get_back_end()); +oracle_blob_back_end * blobBackEnd = static_cast<oracle_blob_back_end *>(b.get_back_end()); OCILobDisableBuffering(sessionBackEnd->svchp_, sessionBackEnd->errhp_, blobBackEnd->lobp_); </pre> -<p>The above code creates the <code>BLOB</code> object and uses two calls -to the <code>getBackEnd</code> function (on both the <code>Session</code> -and the <code>BLOB</code> objects) to get access to the actual backend +<p>The above code creates the <code>blob</code> object and uses two calls +to the <code>get_back_end</code> function (on both the <code>session</code> +and the <code>blob</code> objects) to get access to the actual backend objects. Assuming that it is the <code>"oracle"</code> backend which is in use, the downcasts allow to access all relevant low-level handles and use them in the call to the <code>OCILobDisableBuffering</code> function. This way, the -BLOB handle was configured in a way that the SOCI library itself would +BLOB handle was configured in a way that the SOCI library alone would not allow.</p> <pre class="example"> -RowID rid(sql); // sql is a Session object +rowid rid(sql); // sql is a session object sql << "select oid from mytable where id = 7", into(rid); -PostgreSQLRowIDBackEnd *rbe = static_cast<PostgreSQLRowIDBackEnd *>(rid.getBackEnd()); +postgresql_rowid_back_end * rbe = static_cast<postgresql_rowid_back_end *>(rid.get_back_end()); unsigned long oid = rbe->value_; </pre> -<p>The above example retrieves the <code>RowID</code> ("something" that +<p>The above example retrieves the <code>rowid</code> ("something" that identifies the -row in the table) from the table and uses the <code>getBackEnd</code> +row in the table) from the table and uses the <code>get_back_end</code> function to extract the actual object that implements this functionality. Assuming that it is the <code>"postgresql"</code> backend which is in use, the downcast is -performed to use the <code>PostgreSQLRowIDBackEnd</code> interface to +performed to use the <code>postgresql_rowid_back_end</code> interface to get the actual OID value that is a physical, low-level implementation of row identifier on PostgreSQL databases.</p> @@ -77,7 +77,7 @@ low-level handles and descriptors are available.</p> <table class="foot-links" border="0" cellpadding="2" cellspacing="2"> <tr> <td class="foot-link-left"> - <a href="statements.html">Previous (Statements, procedures and transactions)</a> + <a href="statements.html">Previous (Interfaces)</a> </td> <td class="foot-link-right"> <a href="reference.html">Next (Client reference)</a> diff --git a/doc/boost.html b/doc/boost.html new file mode 100644 index 00000000..dc441e8b --- /dev/null +++ b/doc/boost.html @@ -0,0 +1,106 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> +<head> + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> + <link rel="stylesheet" type="text/css" href="style.css" /> + <title>SOCI - integration with Boost</title> +</head> + +<body> +<p class="banner">SOCI - The C++ Database Access Library</p> + +<h2>Integration with Boost</h2> + +<p>The SOCI user code can be easily integrated with the <a href="http://www.boost.org/" target="_blank">Boost library</a> thanks to the very flexible type conversion facility. There are three important Boost types that are supported out of the box.</p> + +<h4>boost::optional<T></h4> + +<p><code>boost::optional<T></code> provides an alternative way to support the null data condition and as such relieves the user from necessity to handle separate indicator values.</p> +<p>The <code>boost::optional<T></code> objects can be used everywhere where the regular user provided +values are expected.</p> +<p>Example:</p> + +<pre class="example"> +boost::optional<string> name; +sql << "select name from person where id = 7", into(name); + +if (name.is_initialized()) +{ + // OK, the name was retrieved and is not-null + cout << "The name is " << name.get(); +} +else +{ + // the name is null +} +</pre> + +<p>The <code>boost::optional<T></code> objects are fully supported for both <code>into</code> and <code>use</code> elements, in both single and vector forms. They can be also used for user-defined data types.</p> + +<h4>boost::tuple<T1, ...></h4> + +<p><code>boost::tuple<T1, ...></code> allows to work with whole rows of information and in some cases can be more convenient to use than the more dynamically-oriented <code>row</code> type.</p> +<p>Example:</p> + +<pre class="example"> +boost::tuple<string, string, int> person; + +sql << "select name, phone, salary from persons where ...", + into(person); +</pre> + +<p>Tuples are supported for both <code>into</code> and <code>use</code> elements. They can be used with <code>rowset</code> as well.</p> + +<p>Tuples can be also composed with <code>boost::optional<T></code>:</p> + +<pre class="example"> +boost::tuple<string, boost::optional<string>, int> person; + +sql << "select name, phone, salary from persons where ...", + into(person); + +if (person.get<1>().is_initialized()) +{ + // the given person has a phone number +} +else +{ + // this person does not have a phone number +} +</pre> + +<h4>boost::fusion::vector<T1, ...></h4> + +<p>The <code>boost::fusion::vector</code> types are supported in the same way as tuples.</p> + +<h4>boost::gregorian::date</h4> + +<p>The <code>boost::gregorian::date</code> is provided as a conversion for base type <code>std::tm</code> and can be used as a replacement for it.</p> + +<div class="note"> +<p><span class="note">Optional integration:</span></p> +<p>The integration with Boost types is optional and <i>not</i> enabled by default, which means that SOCI can be compiled and used without any dependency on Boost.</p> +<p>In order to enable the support for any of the above types, the user needs to either include one of these headers:</p> +<pre class="example"> +#include <boost-optional.h> +#include <boost-tuple.h> +#include <boost-fusion.h> +#include <boost-gregorian-date.h> +</pre> +<p>or to define the <code>SOCI_USE_BOOST</code> macro before including the <code>soci.h</code> main header file. Note that in this case the support for <code>boost::fusion::vector</code> is enabled only if the detected Boost version is at least 1.35.</p> +</div> + +<table class="foot-links" border="0" cellpadding="2" cellspacing="2"> + <tr> + <td class="foot-link-left"> + <a href="statements.html">Previous (Multithreading)</a> + </td> + <td class="foot-link-right"> + <a href="interfaces.html">Next (Interfaces)</a> + </td> + </tr> +</table> + +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> +</body> +</html> diff --git a/doc/errors.html b/doc/errors.html index 7baa4f79..92534d04 100644 --- a/doc/errors.html +++ b/doc/errors.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -11,7 +11,7 @@ <h2>Errors</h2> -<p>All DB-related errors manifest themselves as exceptions of type <code>SOCIError</code>, +<p>All DB-related errors manifest themselves as exceptions of type <code>soci_error</code>, which is derived from <code>std::runtime_error</code>.<br /> This allows to handle database errors within the standard exception framework:</p> @@ -23,7 +23,7 @@ int main() { // regular code } - catch (exception const &e) + catch (exception const & e) { cerr << "Bang! " << e.what() << endl; } @@ -32,9 +32,9 @@ int main() <div class="note"> <p><span class="note">Portability note:</span></p> -<p>The Oracle backend can also throw the instances of the <code>OracleSOCIError</code>, -which is publicly derived from <code>SOCIError</code> and has an -additional public <code>errNum_</code> +<p>The Oracle backend can also throw the instances of the <code>oracle_soci_error</code>, +which is publicly derived from <code>soci_error</code> and has an +additional public <code>err_num_</code> member containing the Oracle error code:</p> <pre class="example"> @@ -44,12 +44,40 @@ int main() { // regular code } - catch (OracleSOCIError const &e) + catch (oracle_soci_error const & e) { - cerr << "Oracle error: " << e.errNum_ + cerr << "Oracle error: " << e.err_num_ << " " << e.what() << endl; } - catch (exception const &e) + catch (exception const & e) + { + cerr << "Some other error: " << e.what() << endl; + } +} +</pre> +</div> + +<div class="note"> +<p><span class="note">Portability note:</span></p> +<p>The MySQL backend can throw instances of the <code>mysql_soci_error</code>, +which is publicly derived from <code>soci_error</code> and has an +additional public <code>err_num_</code> +member containing the MySQL error code (as returned by +<code>mysql_errno()</code>):</p> + +<pre class="example"> +int main() +{ + try + { + // regular code + } + catch (mysql_soci_error const & e) + { + cerr << "MySQL error: " << e.err_num_ + << " " << e.what() << endl; + } + catch (exception const & e) { cerr << "Some other error: " << e.what() << endl; } @@ -68,6 +96,6 @@ int main() </tr> </table> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/exchange.html b/doc/exchange.html index 1cedaaa6..1132a7b4 100644 --- a/doc/exchange.html +++ b/doc/exchange.html @@ -1,5 +1,5 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -19,7 +19,10 @@ <a href="#bind_position">Binding by position</a><br /> <a href="#bind_name">Binding by name</a><br /> </div> -<a href="exchange.html#indicators">Indicators</a><br /> +<a href="exchange.html#data_states">Handling of nulls and other conditions</a><br /> +<div class="navigation-indented"> + <a href="#indicators">Indicators</a><br /> +</div> <a href="#types">Types</a><br /> <div class="navigation-indented"> <a href="#static">Static binding</a><br /> @@ -64,8 +67,7 @@ resultset binding</a> for the exception to this rule).</p> <h4 id="bind_input">Binding input data</h4> -<p>The <code>use</code> expression is used (no pun intended) to -associate the SQL placeholder (written with colon) with the local data:</p> +<p>The <code>use</code> expression associates the SQL placeholder (written with colon) with the local data:</p> <pre class="example"> int val = 7; @@ -125,8 +127,9 @@ match.</p> <h4 id="bind_name">Binding by name</h4> <p>The SQL placeholders that have their names (with colon) can be bound -by name. -This allows to use different order:</p> +by name to clearly associate the local variable with the given placehorder.</p> + +<p>This explicit naming allows to use different order of elements:</p> <pre class="example"> string firstName = "John", lastName = "Smith"; @@ -142,15 +145,64 @@ string addr = "..."; sql << "update person" " set mainaddress = :addr, contactaddress = :addr" " where id = 7", - use(addr, "addr); + use(addr, "addr"); +</pre> + +<div class="note"> +<p><span class="note">Object lifetime and immutability:</span></p> +<p>SOCI assumes that local variables provided as <code>use</code> elements +live at least as long at it takes to execute the whole statement. +In short statement forms like above, the statement is executed <i>sometime</i> +at the end of the full expression and the whole process is driven by the invisible +temporary object handled by the library. If the data provided by user comes +from another temporary variable, it might be possible for the compiler to arrange +them in a way that the user data will be destroyed <i>before</i> the statement will +have its chance to execute, referencing objects that no longer exist:</p> +<pre class="example"> +// dangerous code: + +string getNameFromSomewhere(); + +sql << "insert into person(name) values(:n)", + use(getNameFromSomewhere()); +</pre> +<p>In the above example, the data passed to the database comes from the temporary +variable that is a result of call to <code>getNameFromSomewhere</code> - this +should be avoided and named variables should be used to ensure safe lifetime relations:</p> +<pre class="example"> +// safe code: + +string getNameFromSomewhere(); + +string name = getNameFromSomewhere(); +sql << "insert into person(name) values(:n)", + use(name); +</pre> + +<p>It is still possible to provide <code>const</code> data for use elements. +Note that some database servers, like Oracle, allow PL/SQL procedures to modify their +in/out parameters - this is detected by the SOCI library and an error is reported +if the database attempts to modify the <code>use</code> element that holds <code>const</code> +data.</p> +<p>The above example can be ultimately written in the following way:</p> +<pre class="example"> +// safe and efficient code: + +string getNameFromSomewhere(); + +const string & name = getNameFromSomewhere(); +sql << "insert into person(name) values(:n)", + use(name); </pre> +</div> <div class="note"> <p><span class="note">Portability notes:</span></p> <p>The PostgreSQL backend allows to use the "native" PostgreSQL way of naming parameters in the query, which is by numbers like <code>$1</code>, <code>$2</code>, <code>$3</code>, etc. In fact, the backend <i>rewrites</i> -the given query to the native form. For portability reasons, it is +the given query to the native form - and this is also one of the very few places +where SOCI intrudes into the SQL query. For portability reasons, it is recommended to use named parameters, as shown in the examples above.<br /> The query rewriting can be switched off by compiling the backend with the <code>SOCI_PGSQL_NOBINDBYNAME</code> name defined. Note that in this case @@ -159,7 +211,9 @@ statement preparation relies on successful query rewriting. In practice, both macros will be needed for PostgreSQL server older than 8.0.</p> </div> -<h3 id="indicators">Indicators</h3> +<h3 id="data_states">Handling nulls and other conditions</h3> + +<h4 id="indicators">Indicators</h4> <p>In order to support null values and other conditions which are not real errors, the concept of <i>indicator</i> is provided.</p> @@ -173,11 +227,11 @@ select name from person where id = 7 <ol> <li>there is a person with id = 7 and his name is returned</li> <li>there is a person with id = 7, but he has no name (his name is -null)</li> +null in the database table)</li> <li>there is no such person</li> </ol> -<p>Whereas the first alternative is easy, the other two are more +<p>Whereas the first alternative is easy to handle, the other two are more complex. Moreover, they are not necessarily errors from the application's point of view and what's more interesting, they are <i>different</i> and the application may wish to detect which is the case.<br /> @@ -185,34 +239,38 @@ The following example does this:</p> <pre class="example"> string name; -eIndicator ind; +indicator ind; sql << "select name from person where id = 7", into(name, ind); -switch (ind) +if (sql.got_data()) +{ + switch (ind) + { + case i_ok: + // the data was returned without problems + break; + case i_null: + // there is a person, but he has no name (his name is null) + break; + case i_truncated: + // the name was returned only in part, + // because the provided buffer was too short + // (not possible with std::string, but possible with char* and char[]) + break; + } +} +else { -case eOK: - // the data was returned without problems - break; -case eNoData: - // no such person - break; -case eNull: - // there is a person, but he has no name (his name is null) - break; -case eTruncated: - // the name was returned only in part, - // because the provided buffer was too short - // (not possible with std::string, but possible with char* and char[]) - break; + // no such person in the database } </pre> <p>The use of indicator variable is optional, but if it is not used and -the result would be either <code>eNoData</code> or <code>eNull</code>, +the result would be <code>i_null</code>, then the exception is thrown. This means that you should use indicator variables everywhere where the application logic (and database schema) -allow "no such object" or "attribute not set" conditions.</p> +allow the "attribute not set" condition.</p> <p>Indicator variables can be also used when binding input data, to control whether the data is to be used as provided, or explicitly @@ -221,7 +279,7 @@ overrided to be null:</p> <pre class="example"> int id = 7; string name; -eIndicator ind = eNull; +indicator ind = i_null; sql << "insert into person(id, name) values(:id, :name)", use(id), use(name, ind); </pre> @@ -234,7 +292,7 @@ based insert, update, and select statements:</p> <pre class="example"> vector<string> names(100); -vector<eIndicator> inds; +vector<indicator> inds; sql << "select name from person where id = 7", into(names, inds); </pre> @@ -249,19 +307,23 @@ actually read.</p> <pre class="example"> vector<int> ids; vector<string> names; -vector<eIndicator> nameIndicators; +vector<indicator> nameIndicators; for (int i = 0; i != 10; ++i) { ids.push_back(i); names.push_back(""); - nameIndicators.push_back(eNull); + nameIndicators.push_back(i_null); } sql << "insert into person(id, name) values(:id, :name)", use(ids), use(name, nameIndicators); </pre> +<p>See also <a href="boost.html">Integration with Boost</a> to learn +how the Boost.Optional library can be used to handle null data conditions +in a more natural way.</p> + <h3 id="types">Types</h3> <h4 id="static">Static type binding</h4> @@ -276,15 +338,15 @@ and <code>use</code> expressions:</p> <ul> <li><code>char</code> (for character values)</li> <li><code>short</code>, <code>int</code>, <code>unsigned -long</code>, <code>double</code> (for numeric values)</li> +long</code>, <code>long long</code>, <code>double</code> (for numeric values)</li> <li><code>char*</code>, <code>char[]</code>, <code>std::string</code> (for string values)</li> <li><code>std::tm</code><code></code> (for datetime values)</li> - <li><code>SOCI::Statement</code> (for nested statements and PL/SQL + <li><code>soci::statement</code> (for nested statements and PL/SQL cursors)</li> - <li><code>SOCI::BLOB</code> (for Binary Large OBjects)</li> - <li><code>SOCI::RowID</code> (for row identifiers)</li> + <li><code>soci::blob</code> (for Binary Large OBjects)</li> + <li><code>soci::row_id</code> (for row identifiers)</li> </ul> <p>See the test code that accompanies the library to see how each of @@ -300,6 +362,7 @@ following <code>std::vector</code> based into and use types: <li><code>std::vector<short></code></li> <li><code>std::vector<int></code></li> <li><code>std::vector<unsigned long></code></li> + <li><code>std::vector<long long></code></li> <li><code>std::vector<double></code></li> <li><code>std::vector<std::string></code></li> <li><code>std::vector<std::tm></code></li> @@ -312,98 +375,96 @@ at a time. See below for examples.</p> <h4 id="dynamic">Dynamic resultset binding</h4> <p>For certain applications it is desirable to be able to select data from -arbitrarily -structured tables (e.g. via "<code>select * </code>") and format the +arbitrarily structured tables (e.g. via "<code>select * from ...</code>") and format the resulting data based upon its type. -SOCI supports this through the <code>SOCI::Row</code> and <code>SOCI::ColumnProperties</code> +SOCI supports this through the <code>soci::row</code> and <code>soci::column_properties</code> classes.</p> -<p>Data is selected into a <code>Row</code> object, which holds <code>ColumnProperties</code> +<p>Data is selected into a <code>row</code> object, which holds <code>column_properties</code> objects describing -the type of data contained in each column. Once the data type for each +the attributes of data contained in each column. Once the data type for each column is known, the data can be formatted appropriately.</p> <p>For example, the code below creates an XML document from a selected row of data from an arbitrary table:</p> <pre class="example"> -Session sql("oracle", "service=db1", "user=scott", "password=tiger"); - -sql << "create table ex(num NUMBER, str VARCHAR2(20), dt DATE)"; - -int num = 123; -std::string str("my name"); -std::time_t dt = time(0); - -sql << "insert into ex values(:num, :str, :dt)", - use(num), use(str), use(dt); - -Row r; -sql << "select * from ex", into(r); +row r; +sql << "select * from some_table", into(r); std::ostringstream doc; doc << "<row>" << std::endl; -for(int i=0; i<r.size(); ++i) +for(std::size_t i = 0; i != r.size(); ++i) { - const ColumnProperties& props = r.getProperties(i); - doc << '<' << props.getName() << '>'; - switch(props.getDataType()) + const column_properties & props = r.get_properties(i); + + doc << '<' << props.get_name() << '>'; + + switch(props.get_data_type()) { - case eString: + case dt_string: doc << r.get<std::string>(i); break; - case eDouble: + case dt_double: doc << r.get<double>(i); break; - case eInteger: + case dt_integer: doc << r.get<int>(i); break; - case eUnsignedLong: + case dt_unsigned_long: doc << r.get<unsigned long>(i); break; - case eDate: + case dt_long_long: + doc << r.get<long long>(i); + break; + case dt_date: std::tm when = r.get<std::tm>(i); doc << asctime(&when); break; } - doc << "</" << props.getName() << '>' << std::endl; + + doc << "</" << props.get_name() << '>' << std::endl; } doc << "</row>"; </pre> <p>The type <code>T</code> parameter that should be passed to -<code>Row::get<T>()</code> depends on the SOCI Data Type that +<code>row::get<T>()</code> depends on the SOCI data type that is returned from -<code>ColumnProperties::getDataType()</code>.</p> -<p><code>Row::get<T>()</code> +<code>column_properties::get_data_type()</code>.</p> +<p><code>row::get<T>()</code> throws an exception of type <code>std::bad_cast</code> if an incorrect type <code>T</code> is -used.</p> +requested.</p> <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr> <th>SOCI Data Type</th> - <th><code>Row::get<T></code> specialization</th> + <th><code>row::get<T></code> specialization</th> </tr> <tr> - <td><code>eDouble</code></td> + <td><code>dt_double</code></td> <td><code>double</code></td> </tr> <tr> - <td><code>eInteger</code></td> + <td><code>dt_integer</code></td> <td><code>int</code></td> </tr> <tr> - <td><code>eUnsignedLong</code></td> + <td><code>dt_unsigned_long</code></td> <td><code>unsigned long</code></td> </tr> <tr> - <td><code>eString</code></td> + <td><code>dt_long_long</code></td> + <td><code>long long</code></td> + </tr> + <tr> + <td><code>dt_string</code></td> <td><code>std::string</code></td> </tr> <tr> - <td><code>eDate</code></td> + <td><code>dt_date</code></td> <td><code>std::tm</code><code></code></td> </tr> </tbody> @@ -412,11 +473,11 @@ used.</p> <p>The mapping of underlying database column types to SOCI datatypes is database specific. See the <a href="backends/index.html">backend documentation</a> for details.</p> -<p>It is also possible to extract data from the <code>Row</code> object using its stream-like -interface:</p> +<p>It is also possible to extract data from the <code>row</code> object using its stream-like +interface, where each extracted variable should have matching type respective to its position in the chain:</p> <pre class="example"> -Row r; +row r; sql << "select name, address, age from persons where id = 123", into(r); string name, address; @@ -433,127 +494,107 @@ r >> name >> address >> age; <h4 id="custom_types">Extending SOCI to support custom (user-defined) C++ types</h4> -<p>SOCI can be easily extended through user code so that custom types can -be used transparently to insert into, update, and select from the -database.</p> +<p>SOCI can be easily extended with support for user-defined datatypes.</p> -<p>To do so, provide an appropriate specialization of the <code>TypeConversion</code> -struct that converts to and from one of the following SOCI Base Types:</p> +<p>The extension mechanism relies on appropriate specialization of the <code>type_conversion</code> +struct that converts to and from one of the following SOCI base types:</p> <ul> <li><code>double</code></li> <li><code>int</code></li> <li><code>unsigned long</code></li> + <li><code>long long</code></li> <li><code>std::string</code></li> <li><code>char</code></li> <li><code>std::tm</code></li> </ul> -<p>There are three required class members for a valid <code>TypeConversion</code> +<p>There are three required class members for a valid <code>type_conversion</code> specialization:</p> <ul> - <li>the <code>base_type</code> trait, defining the base type</li> - <li>the <code>from()</code> static member function, converting from + <li>the <code>base_type</code> type definition, aliasing either one of the base types <i>or another ser-defined type</i></li> + <li>the <code>from_base()</code> static member function, converting from the base type</li> - <li>the <code>to()</code> static member function, converting to the + <li>the <code>to_base()</code> static member function, converting to the base type</li> </ul> -<p>(Note that no database-specific code is required.)</p> +<p>Note that no database-specific code is required to define user conversion.</p> -<p>The following example shows how application code could extend SOCI to -transparently support <code>boost::gregorian::date</code>:</p> +<p>The following example shows how the user can extend SOCI to +support his own type <code>MyInt</code>, which here is some wrapper +for the fundamental <code>int</code> type:</p> <pre class="example"> -#include "boost/date_time/gregorian/gregorian.hpp" -namespace SOCI -{ -template<> -struct TypeConversion<boost::gregorian::date> +class MyInt { - typedef std::tm base_type; - static boost::gregorian::date from(std::tm& t) - { - boost::gregorian::months_of_year month = - static_cast<boost::gregorian::months_of_year>(t.tm_mon + 1); +public: + MyInt() {} + MyInt(int i) : i_(i) {} - boost::gregorian::date d(t.tm_year + 1900, month, t.tm_mday); - return d; - } - static std::tm to(boost::gregorian::date& d) - { - std::tm t; - - t.tm_isdst = -1; - t.tm_year = d.year() - 1900; - t.tm_mon = d.month() - 1; - t.tm_mday = d.day(); - t.tm_hour = 0; - t.tm_min = 0; - t.tm_sec = 0; - std::mktime(&t); //normalize and compute remaining fields - - return t; - } + void set(int i) { i_ = i; } + int get() const { return i_; } + +private: + int i_; }; + +namespace soci +{ + template <> + struct type_conversion<MyInt> + { + typedef int base_type; + + static void from_base(int i, indicator ind, MyInt & mi) + { + if (ind == i_null) + { + throw soci_error("Null value not allowed for this type"); + } + + mi.set(i); + } + + static void to_base(const MyInt & mi, int & i, indicator & ind) + { + i = mi.get(); + ind = i_ok; + } + }; } </pre> -<p>With the above <code>TypeConversion</code> specialization in place, it -is possible to -use <code>boost::gregorian::date</code> directly with SOCI, binding -input or output, either statically or via a dynamic resultset:</p> +<p>The above specialization for <code>soci::type_conversion<MyInt></code> is enough +to enable the following:</p> <pre class="example"> -using boost::gregorian::date; - -Session sql("oracle", "service=db1", "user=scott", "password=tiger"); - -sql << "create table test_boost(when DATE)"; -date dIn(1999, boost::gregorian::Feb, 1); -sql << "insert into test_boost values(:when)", use(dIn); +MyInt i; -date dOut(boost::gregorian::not_a_date_time); -sql << "select when from test_boost", into(dOut); -assert(dIn == dOut); +sql << "select count(*) from person", into(i); -Row r; -sql << "select * from test_boost", into(r); -assert(r.get<date>(0) == dIn); - -std::vector<date> datesIn; -for (int i = 2; i != 12; ++i) -{ - date d(1999, boost::gregorian::Feb, i); - datesIn.push_back(d); -} -sql << "insert into test_boost values(:when)", use(datesIn); - -std::vector<date> datesOut(10); -sql << "select when from test_boost where when > :d", use(dIn), into(datesOut); -assert(datesIn == datesOut); +cout << "We have " << i.get() << " persons in the database.\n"; </pre> -<p>The other possibility to extend SOCI with custom data types is to use -the <code>IntoType<T></code> and <code>UseType<T></code> +<p>Note that there is a number of types from the Boost library integrated with SOCI out of the box, see <a href="boost.html">Integration with Boost</a> for complete description. Use these as examples of conversions for more complext data types.</p> + +<p>Another possibility to extend SOCI with custom data types is to use +the <code>into_type<T></code> and <code>use_type<T></code> class templates, which specializations can be user-provided. These specializations need to implement the interface defined by, -respectively, the <code>IntoTypeBase</code> and <code>UseTypeBase</code> +respectively, the <code>into_type_base</code> and <code>use_type_base</code> classes.</p> -<p>Note that when specializing these template classes for handling your -own types, you are free to choose the expected parameters for the -classes' constructors. The template functions <code>into</code> and <code>use</code> -support up to 5 parameters, which are just forwarded to the constructor -of appropriate class. The only convention is that when the indicator +<p>Note that when specializing these template classes the only convention +is that when the indicator variable is used (see below), it should appear in the second position. Please refer to the library source code to see how this is done for the standard types.</p> <h4 id="object_relational">Object-relational mapping</h4> -<p>SOCI provides a class called <code>Values</code> specifically to -enable object-relational mapping via <code>TypeConversion</code> +<p>SOCI provides a class called <code>values</code> specifically to +enable object-relational mapping via <code>type_conversion</code> specializations.</p> <p>For example, the following code maps a <code>Person</code> object to @@ -561,8 +602,8 @@ and from a database table containing columns <code>"ID"</code>, <code>"FIRST_NAME"</code>, <code>"LAST_NAME"</code>, and <code>"GENDER"</code>.</p> -<p>Note that the mapping is non-invasive - the <code>Person </code>object -itself doesn't contain any SOCI-specific code:</p> +<p>Note that the mapping is non-invasive - the <code>Person</code> object +itself does not contain any SOCI-specific code:</p> <pre class="example"> struct Person @@ -573,14 +614,13 @@ struct Person std::string gender; }; -namespace SOCI +namespace soci { template<> struct TypeConversion<Person> { - typedef Values base_type; - static Person from(Values const &v) + typedef values base_type; + static void from_base(values const & v, indicator /* ind */, Person & p) { - Person p; p.id = v.get<int>("ID"); p.firstName = v.get<std::string>("FIRST_NAME"); p.lastName = v.get<std::string>("LAST_NAME"); @@ -590,7 +630,7 @@ template<> struct TypeConversion<Person> p.gender = v.get<std::string>("GENDER", "unknown"); // alternatively, the indicator can be tested directly: - // if (v.indicator("GENDER") == eNull) + // if (v.indicator("GENDER") == i_null) // { // p.gender = "unknown"; // } @@ -598,27 +638,24 @@ template<> struct TypeConversion<Person> // { // p.gender = v.get<std::string>("GENDER"); // } - - return p; } - static Values to(Person &p) + static void to_base(const Person & p, values & v, indicator & ind) { - Values v; v.set("ID", p.id); v.set("FIRST_NAME", p.firstName); v.set("LAST_NAME", p.lastName); - v.set("GENDER", p.gender, p.gender.empty() ? eNull : eOK); - return v; + v.set("GENDER", p.gender, p.gender.empty() ? i_null : i_ok); + ind = i_ok; } }; } </pre> -<p>With the above <code>TypeConversion</code> specialization in place, it +<p>With the above <code>type_conversion</code> specialization in place, it is possible to use <code>Person</code> directly with SOCI:</p> <pre class="example"> -Session sql("oracle", "service=db1", "user=scott", "password=tiger"); +session sql(oracle, "service=db1 user=scott password=tiger"); Person p; p.id = 1; @@ -639,9 +676,9 @@ sql << "update person set first_name = :FIRST_NAME " </pre> <div class="note"> -<p><span class="note">Note:</span> The <code>Values</code> -class is currently not suited for use outside of <code>TypeConversion</code> -specializations. It is specially designed to facilitate +<p><span class="note">Note:</span> The <code>values</code> +class is currently not suited for use outside of <code>type_conversion</code> +specializations. It is specially designed to facilitate object-relational mapping when used as shown above.</p> </div> @@ -651,14 +688,14 @@ object-relational mapping when used as shown above.</p> large objects (BLOBs - Binary Large OBjects).</p> <pre class="example"> -BLOB b(sql); // sql is a Session object +blob b(sql); // sql is a session object sql << "select mp3 from mymusic where id = 123", into(b); </pre> -<p>The following functions are provided in the <code>BLOB</code> +<p>The following functions are provided in the <code>blob</code> interface, mimicking the file-like operations:</p> <ul> - <li><code>std::size_t getLen();</code></li> + <li><code>std::size_t get_len();</code></li> <li><code>std::size_t read(std::size_t offset, char *buf, std::size_t toRead);</code></li> <li><code>std::size_t write(std::size_t offset, char const *buf, @@ -694,6 +731,6 @@ the PostgreSQL backend.</li> </tr> </table> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/index.html b/doc/index.html index 7d590e75..8b33de05 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -17,6 +17,9 @@ <a href="basics.html">Connections and simple queries</a><br /> <a href="exchange.html">Exchanging data</a><br /> <a href="statements.html">Statements, procedures and transactions</a><br /> +<a href="multithreading.html">Multithreading and SOCI</a><br /> +<a href="boost.html">Integration with Boost</a><br /> +<a href="interfaces.html">Interfaces</a><br /> <a href="beyond.html">Beyond SOCI</a><br /> <a href="reference.html">Client interface reference</a><br /> <a href="backends.html">Backends reference</a><br /> @@ -35,7 +38,7 @@ #include <string> #include <exception> -using namespace SOCI; +using namespace soci; using namespace std; bool getName(string &name) @@ -48,7 +51,7 @@ int main() { try { - Session sql(oracle, "service=mydb user=john password=secret"); + session sql(oracle, "service=mydb user=john password=secret"); int count; sql << "select count(*) from phonebook", into(count); @@ -59,11 +62,11 @@ int main() while (getName(name)) { string phone; - eIndicator ind; + indicator ind; sql << "select phone from phonebook where name = :name", into(phone, ind), use(name); - if (ind == eOK) + if (ind == i_ok) { cout << "The phone number is " << phone << '\n'; } @@ -89,6 +92,6 @@ int main() </tr> </table> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/interfaces.html b/doc/interfaces.html new file mode 100644 index 00000000..ea41b568 --- /dev/null +++ b/doc/interfaces.html @@ -0,0 +1,102 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> +<head> + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> + <link rel="stylesheet" type="text/css" href="style.css" /> + <title>SOCI - integration with Boost</title> +</head> + +<body> +<p class="banner">SOCI - The C++ Database Access Library</p> + +<h2>Interfaces</h2> + +<p>One of the major features of SOCI, although not immediately visible, is the variety of interfaces (APIs) that are available for the user. These can be divided into <i>sugar</i>, <i>core</i> and <i>simple</i>.</p> + +<h4>Sugar</h4> + +<p>The most exposed and promoted interface supports the syntax sugar that makes SOCI similar in look and feel to embedded SQL. The example of application code using this interface is:</p> + +<pre class="example"> +session sql("postgresql://dbname=mydb"); + +int id = 123; +string name; + +sql << "select name from persons where id = :id", into(name), use(id); +</pre> + +<h4>Core</h4> + +<p>The above example is equivalent to the following, more explicit sequence of calls:</p> +<pre class="example"> +session sql("postgresql://dbname=mydb"); + +int id = 123; +string name; + +statement st(sql); +st.exchange(into(name)); +st.exchange(use(id)); +st.alloc(); +st.prepare("select name from persons where id = :id"); +st.define_and_bind(); +st.execute(true); +</pre> + +<p>The value of the <i>core</i> interface is that it is the basis for all other interfaces, and can be also used by developers to easily prepare their own convenience interfaces. Users who cannot or for some reason do not want to use the natural <i>sugar</i> interface should try the <i>core</i> one as the foundation and access point to all SOCI functionality.</p> + +<p>Note that the <i>sugar</i> interface wraps only those parts of the <i>core</i> that are related to data binding and query streaming.</p> + +<h4>Simple</h4> + +<p>The <i>simple</i> interface is provided specifically to allow easy integration of the SOCI library with other languages that have the ability to link with binaries using the "C" calling convention. To facilitate this integration, the <i>simple</i> interface does not use any pointers to data except C-style strings and opaque handles, but the consequence of this is that user data is managed by SOCI and not by user code. To avoid exceptions passing the module boundaries, all errors are reported as state variables of relevant objects.</p> + +<p>The above examples can be rewritten as (without error-handling):</p> + +<pre class="example"> +#include <soci-simple.h> + +// ... +session_handle sql = soci_create_session("postgresql://dbname=mydb"); + +statement_handle st = soci_create_statement(sql); + +soci_use_int(st, "id"); +soci_set_use_int(st, "id", 123); + +int namePosition = soci_into_string(st); + +soci_prepare(st, "select name from persons where id = :id"); + +soci_execute(st, true); + +char const * name = soci_get_into_string(st, namePosition); + +printf("name is %s\n", name); + +soci_destroy_statement(st); +soci_destroy_session(sql); +</pre> + +<p>The <i>simple</i> interface supports single and bulk data exchange for static binding. Dynamic row description is not supported in this release.</p> +<p>See <a href="reference.html#simpleclient">Simple client interface</a> reference documentation for more details.</p> + +<h4>Low-level backend interface</h4> + +<p>The low-level backend interface allows to interact with backends directly and in principle allows to access the database without involving any other component. There is no particular reason to use this interface in the user code.</p> + +<table class="foot-links" border="0" cellpadding="2" cellspacing="2"> + <tr> + <td class="foot-link-left"> + <a href="boost.html">Previous (Boost)</a> + </td> + <td class="foot-link-right"> + <a href="beyond.html">Next (Beyond SOCI)</a> + </td> + </tr> +</table> + +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> +</body> +</html> diff --git a/doc/multithreading.html b/doc/multithreading.html new file mode 100644 index 00000000..a22a742e --- /dev/null +++ b/doc/multithreading.html @@ -0,0 +1,64 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> +<head> + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> + <link rel="stylesheet" type="text/css" href="style.css" /> + <title>SOCI - multithreading</title> +</head> + +<body> +<p class="banner">SOCI - The C++ Database Access Library</p> + +<h2>Multithreading</h2> + +<p>The general rule for multithreading is that SOCI classes are <i>not</i> thread-safe, meaning that their instances should not be used concurrently by multiple threads.</p> + +<p>The simplest solution for multithreaded code is to set up a separate <code>session</code> object for each thread that needs to inteact with the database. Depending on the design of the client application this might be also the most straightforward approach.</p> + +<p>For some applications, however, it might be preferable to decouple the set of threads from the set of sessions, so that they can be optimized separately with different resources in mind. The <code>connection_pool</code> class is provided for this purpose:</p> + +<pre class="example"> +// phase 1: preparation + +const size_t poolSize = 10; +connection_pool pool(poolSize); + +for (size_t i = 0; i != poolSize; ++i) +{ + session & sql = pool.at(i); + + sql.open("postgresql://dbname=mydb"); +} + +// phase 2: usage from working threads + +{ + session sql(pool); + + sql << "select something from somewhere..."; + +} // session is returned to the pool automatically +</pre> + +<p>The <code>connection_pool</code>'s constructor expects the size of the pool and internally creates an array of <code>session</code>s in the disconnected state. Later, the <code>at</code> function provides <i>non-synchronized</i> access to each element of the array. Note that this function is <i>not</i> thread-safe and exists only to make it easier to set up the pool in the initialization phase.</p> + +<p>Note that it is not obligatory to use the same connection parameters for all sessions in the pool, although this will be most likely the usual case.</p> + +<p>The working threads that need to <i>lease</i> a single session from the pool use the dedicated constructor of the <code>session</code> class - this constructor blocks until some session object becomes available in the pool and attaches to it, so that all further uses will be forwarded to the <code>session</code> object managed by the pool. As long as the local <code>session</code> object exists, the associated session in the pool is <i>locked</i> and no other thread will gain access to it. When the local <code>session</code> variable goes out of scope, the related entry in the pool's internal array is released, so that it can be used by other threads. This way, the connection pool guarantees that its session objects are never used by more than one thread at a time.</p> + +<p>Note that the above scheme is the simplest way to use the connection pool, but it is also constraining in the fact that the <code>session</code>'s constructor can <i>block</i> waiting for the availability of some entry in the pool. For more demanding users there are also low-level functions that allow to lease sessions from the pool with timeout on wait. Please consult the <a href="reference.html">reference</a> for details.</p> + +<table class="foot-links" border="0" cellpadding="2" cellspacing="2"> + <tr> + <td class="foot-link-left"> + <a href="statements.html">Previous (Statements, procedures and transactions)</a> + </td> + <td class="foot-link-right"> + <a href="boost.html">Next (Boost)</a> + </td> + </tr> +</table> + +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> +</body> +</html> diff --git a/doc/rationale.html b/doc/rationale.html index e9b9799a..deb5faab 100644 --- a/doc/rationale.html +++ b/doc/rationale.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -13,7 +13,7 @@ <p>This part of the documentation is supposed to gather in a single place the usual questions (and answers) about SOCI with regard to the design -decisions that shaped it.</p> +decisions that have shaped it.</p> <h3>Q: Why "SOCI"?</h3> @@ -40,7 +40,7 @@ SOCI is just "SOCI - The C++ Database Access Library".</p> <p>Still, Oracle is considered to be the main driving server technology in terms of the set of features that are supported by the library. This -also means that backeds for other servers might need to +also means that backends for other servers might need to work around some of the imposed idioms and protocols, but already available and well-working PostgreSQL, MySQL and SQLite3 backends show that it's actually not that @@ -141,7 +141,7 @@ with the text of the query (apart from very few cases), which means that the database server will get exactly the same text of the query as is used in the program. The advantage of this is that there is no new SQL-like -(or even SQL-unlike) +(or even SQL-<i>un</i>like) syntax that you would need to learn, and also that it's much easier to convince a typical DBA to help with SQL tuning or other specialized activities, if he is @@ -168,12 +168,12 @@ while (!sql.eof()) treated as a set of relations - which is exactly what it is. This means that what is read from the database as a result of some SQL query is a <i>set of rows</i>. This set might be -ordered, but it is still a set of rows, not a uniform list of values. +ordered, but it is still a set of rows, not a uniformly flat list of values. This distinction might seem to be unnecessarily low-level and that the uniform stream-like presentation of data is more preferable, but it's actually the other way round - the set of rows is something more -structured (and that structure was <i>designed</i> -into the database) than the flat stream and +structured - and that structure was <i>designed</i> +into the database - than the flat stream and is therefore less prone to programming errors like miscounting the number of values that is expected in each row.</p> @@ -211,15 +211,15 @@ special (which means: "unlikely" to be ever used) value - for example, to use the smallest integer value to indicate null integer. Or to use empty string to indicate null string. And so on.</p> -<p>We think that it's completely wrong. Null (in the database sense) is an +<p>We think that it's <i>completely wrong</i>. Null (in the database sense) is an information <i>about</i> the data. It describes the <i>state</i> of the data and if it's null, then there's <i>no data at all</i>. Nothing. Null. It does not make any sense to talk about some special -value if there is conceptually <i>no</i> -value - especially if we take into account that, for example, the +value if in fact there is <i>no</i> +value at all - especially if we take into account that, for example, the smallest integer value (or whatever else you choose as the "special" value) might not be <i>that</i> -special in any given application or domain.</p> +special in the given application or domain.</p> <p>Thus, SOCI uses a separate indicators to describe the state of exchanged data. It also has an additional benefit of allowing the @@ -230,6 +230,10 @@ character arrays). Truncation is also an information about the data and as such it's better to have it in addition to the data, not as part of it.</p> +<p>Having said that, it is important to point at the <a href="boost.html">Integration with Boost</a> +that allows to use <code>boost::optional<T></code> to conveniently pack together +the data and the information about its state.</p> + <h3>Q: Overloaded comma operator is just obfuscation, I don't like it.</h3> <p>Well, consider the following:</p> @@ -244,7 +248,7 @@ in SOCI the comma operator was overloaded with a good effect.</p> <h3>Q: The <code>operator<<</code> provides a bad abstraction for the "input" statements.</h3> <p>Indeed, the <code>operator<<</code> in the basic SOCI syntax -shows that something (the query) is sent somewhere (to the server). +shows that something (the query) is <i>sent</i> somewhere (to the server). Some people don't like this, especially when the "select" statements are involved. If the high-level idea is to <i>read</i> data from somewhere, then <code>operator<<</code> @@ -286,7 +290,7 @@ questions that were already answered on the <a target="_blank" href="http://www.boost.org/more/license_info.html">Boost license info page</a> and it should also give more confidence to our users - especially to those of them, who already accepted the conditions of the -Boost license (one license less to analyze).</p> +Boost license - the just have one license less to analyze.</p> <p>Still, if for any reason the conditions of this license are not acceptable, we encourage the users to contact us directly (see <a diff --git a/doc/reference.html b/doc/reference.html index 0bfbd8d4..f491794e 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -13,25 +13,27 @@ <div class="navigation"> <a href="#commontypes">commonly used types</a><br /> -<a href="#session">class Session</a><br /> +<a href="#session">class session</a><br /> +<a href="#pool">class connection_pool</a><br /> <a href="#into">function into</a><br /> <a href="#use">function use</a><br /> -<a href="#statement">class Statement</a><br /> -<a href="#procedure">class Procedure</a><br /> -<a href="#typeconversion">class TypeConversion</a><br /> -<a href="#row">class Row</a><br /> -<a href="#columnproperties">class ColumnProperties</a><br /> -<a href="#values">class Values</a><br /> -<a href="#blob">class BLOB</a><br /> -<a href="rowid">class RowID</a><br /> -<a href="#backendfactory">class BackEndFactory</a><br /> +<a href="#statement">class statement</a><br /> +<a href="#procedure">class procedure</a><br /> +<a href="#typeconversion">class type_conversion</a><br /> +<a href="#row">class row</a><br /> +<a href="#columnproperties">class column_properties</a><br /> +<a href="#values">class values</a><br /> +<a href="#blob">class blob</a><br /> +<a href="#rowid">class rowid</a><br /> +<a href="#backendfactory">class backend_factory</a><br /><br /> +<a href="#simpleclient">Simple client interface</a><br /> </div> -<p>The client interface is a set of classes and free functions declared in -the <code>soci.h</code> header file. All names are declared in the <code>SOCI</code> +<p>The core client interface is a set of classes and free functions declared in +the <code>soci.h</code> header file. All names are dbeclared in the <code>soci</code> namespace.</p> -<p>There are also additional names declared in the <code>SOCI::details</code> +<p>There are also additional names declared in the <code>soci::details</code> namespace, but they are not supposed to be directly used by the users of the library and are therefore not documented here. When such types are used in the declarations that are part of the "public" interface, @@ -45,69 +47,99 @@ to the backend interface are named here, but documented on the <a <pre class="example"> // data types, as seen by the user -enum eDataType { eString, eChar, eDate, eDouble, eInteger, - eUnsignedLong }; +enum data_type { dt_string, dt_date, dt_double, dt_integer, + dt_unsigned_long, dt_long_long }; // the enum type for indicator variables -enum eIndicator { eOK, eNoData, eNull, eTruncated }; +enum indicator { i_ok, i_null, i_truncated }; // the type used for reporting exceptions -class SOCIError : public std::runtime_error { /* ... */ }; +class soci_error : public std::runtime_error { /* ... */ }; </pre> -<p>The <code>eDataType</code> type defines the basic SOCI data types. +<p>The <code>data_type</code> type defines the basic SOCI data types. User provided data types need to be associated with one of these basic types.</p> -<p>The <code>eIndicator</code> type defines the possible states of data.</p> +<p>The <code>indicator</code> type defines the possible states of data.</p> -<p>The <code>SOCIError</code> type is used for error reporting.</p> +<p>The <code>soci_error</code> type is used for error reporting.</p> -<h3 id="session">class Session</h3> +<h3 id="session">class session</h3> -<p>The <code>Session</code> class encapsulates the connection to the +<p>The <code>session</code> class encapsulates the connection to the database.</p> <pre class="example"> -class Session +class session { public: - Session(BackEndFactory const &factory, std::string const & connectString); - ~Session(); + session(); + session(backend_factory const & factory, std::string const & connectString); + session(std::string const & backendName, std::string const & connectString); + explicit session(std::string const & connectString); + explicit session(connection_pool & pool); + + ~session(); + + void open(backend_factory const & factory, std::string const & connectString); + void open(std::string const & backendName, std::string const & connectString); + void open(std::string const & connectString); + void close(); + void reconnect(); void begin(); void commit(); void rollback(); + <i>IT</i> once; <i>IT</i> prepare; - template <typename T> <i>IT</i> operator<<(T const &t); + template <typename T> <i>IT</i> operator<<(T const & t); + + bool got_data() const; - void setLogStream(std::ostream *s); - std::ostream * getLogStream() const; + std::ostringstream & get_query_stream(); - std::string getLastQuery() const; + void set_log_stream(std::ostream * s); + std::ostream * get_log_stream() const; - details::SessionBackEnd * getBackEnd(); + std::string get_last_query() const; + + void uppercase_column_names(bool forceToUpper); + + details::session_backend * get_backend(); + + std::string get_backend_name() const; }; </pre> <p>This class contains the following members:</p> <ul> - <li>Constructor expecting the backend factory object (which is -declared in the relevant backend interface) and the generic connection -string, which is interpreted by the backend implementation. Example: + <li>Various constructors. The default one creates the session in the disconnected state. + The others expect the backend factory object, or the backend name, or the URL-like + composed connection string. The last constructor creates a session proxy associated + with the session that is available in the given pool and releases it back to the pool + when its lifetime ends. Example: <pre class="example"> -Session sql(postgresql, "dbname=mydb"); +session sql(postgresql, "dbname=mydb"); +session sql("postgresql", "dbname=mydb"); +session sql("postgresql://dbname=mydb"); </pre> + The constructors that take backend name as string load the shared library (if not yet loaded) + with name computed as <code>libsoci_ABC.so</code> (or <code>libsoci_ABC.dll</code> on Windows) + where <code>ABC</code> is the given backend name. + </li> + <li><code>open</code>, <code>close</code> and <code>reconnect</code> functions for + reusing the same session object many times; the <code>reconnect</code> function attempts + to establish the connection with the same parameters as most recently used with constructor + or <code>open</code>. The arguments for <code>open</code> are treated in the same way as + for constructors. </li> <li><code>begin</code>, <code>commit</code> and <code>rollback</code> -functions for transaction control. Example: -<pre class="example"> -sql.rollback(); -</pre> +functions for transaction control. </li> - <li><code>once</code> member, which is used for performing "instant" + <li><code>once</code> member, which is used for performing <i>instant</i> queries that do not need to be separately prepared. Example: <pre class="example"> sql.once << "drop table persons"; @@ -115,10 +147,10 @@ sql.once << "drop table persons"; </li> <li><code>prepare</code> member, which is used for statement preparation - the result of the statement preparation must be provided -to the constructor of the <code>Statement</code> class. Example: +to the constructor of the <code>statement</code> class. Example: <pre class="example"> int i; -Statement st = (sql.prepare << +statement st = (sql.prepare << "insert into numbers(value) values(:val)", use(i)); </pre> </li> @@ -128,17 +160,70 @@ equivalent operator of the <code>once</code> member. Example: sql << "drop table persons"; </pre> </li> - <li><code>setLogStream</code> and <code>getLogStream</code> functions for setting and getting the current stream object used for basic query logging. By default, it is <code>NULL</code>, which means no logging. The string value that is actually logged into the stream is one-line verbatim copy of the query string provided by the user, without including any data from the <code>use</code> elements. The query is logged exactly once, before the preparation step.</li> - <li><code>getLastQuery</code> function for retrieving the text of the last used query.</li> - <li><code>getBackEnd</code> function that returns the internal + <li><code>got_data</code> returns true if the last executed query had non-empty result.</li> + <li><code>get_query_stream</code> provides direct access to the stream object that is used + to accumulate the query text and exists in particular to allow the user to imbue specific locale + to this stream.</li> + <li><code>set_log_stream</code> and <code>get_log_stream</code> functions for setting and getting + the current stream object used for basic query logging. By default, it is <code>NULL</code>, which means no logging. + The string value that is actually logged into the stream is one-line verbatim copy of the query string provided by the user, + without including any data from the <code>use</code> elements. The query is logged exactly once, before the preparation step.</li> + <li><code>get_last_query</code> retrieves the text of the last used query.</li> + <li><code>uppercase_column_names</code> allows to force all column names to uppercase in dynamic row description; + this function is particularly useful for portability, since various database servers + report column names differently (some preserve case, some change it).</li> + <li><code>get_backend</code> returns the internal pointer to the concrete backend implementation of the session. This is provided for advanced users that need access to the functionality that is not otherwise available.</li> + <li><code>get_backend_name</code> is a convenience forwarder to the same function +of the backend object.</li> </ul> <p>See <a href="basics.html">Connections and simple queries</a> for more examples.</p> +<h3 id="pool">class connection_pool</h3> + +<p>The <code>connection_pool</code> class encapsulates the thread-safe pool of connections +and ensures that only one thread at a time has access to any connection that it manages.</p> + +<pre class="example"> +class connection_pool +{ +public: + explicit connection_pool(std::size_t size); + ~connection_pool(); + + session & at(std::size_t pos); + + std::size_t lease(); + bool try_lease(std::size_t & pos, int timeout); + void give_back(std::size_t pos); +}; +</pre> + +<p>The operations of the pool are:</p> + +<ul> + <li>Constructor that takes the intended size of the pool. After construction, + the pool contains regular <code>session</code> objects in disconnected state.</li> + <li><code>at</code> function that provides direct access to any given entry + in the pool. This function is <i>non-synchronized</i>.</li> + <li><code>lease</code> function waits until some entry is available (which means + that it is not used) and returns the position of that entry in the pool, marking + it as <i>locked</i>.</li> + <li><code>try_lease</code> acts like <code>lease</code>, but allows to set up a + time-out (relative, in milliseconds) on waiting. Negative time-out value means no time-out. + Returns <code>true</code> if the entry was obtained, in which case its position + is written to the <code>pos</code> parametr, and <code>false</code> if no entry + was available before the time-out.</li> + <li><code>give_back</code> should be called when the entry on the given position + is no longer in use and can be passed to other requesting thread.</li> +</ul> +<p>Note: calls to <code>lease</code> and <code>give_back</code> are automated by the +dedicated constructor of the <code>session</code> class, see above.</p> + <h3 id="into">function into</h3> <p>The function <code>into</code> is used for binding local output data @@ -146,19 +231,19 @@ examples.</p> <pre class="example"> template <typename T> -<i>IT</i> into(T &t); +<i>IT</i> into(T & t); template <typename T, typename T1> -<i>IT</i> into(T &t, T1 p1); +<i>IT</i> into(T & t, T1 p1); template <typename T> -<i>IT</i> into(T &t, eIndicator &indicator); +<i>IT</i> into(T & t, indicator & ind); template <typename T, typename T1> -<i>IT</i> into(T &t, eIndicator &ind, T1 p1); +<i>IT</i> into(T & t, indicator & ind, T1 p1); template <typename T> -<i>IT</i> into(T &t, std::vector<eIndicator> &indicator); +<i>IT</i> into(T & t, std::vector<indicator> & ind); </pre> <p>Example:</p> @@ -178,22 +263,22 @@ other words, it defines where the parameters of the query come from).</p> <pre class="example"> template <typename T> -<i>IT</i> use(T &t); +<i>IT</i> use(T & t); template <typename T, typename T1> -<i>IT</i> use(T &t, T1 p1); +<i>IT</i> use(T & t, T1 p1); template <typename T> -<i>IT</i> use(T &t, eIndicator &indicator); +<i>IT</i> use(T & t, indicator & ind); template <typename T, typename T1> -<i>IT</i> use(T &t, eIndicator &ind, T1 p1); +<i>IT</i> use(T & t, indicator & ind, T1 p1); template <typename T> -<i>IT</i> use(T &t, std::vector<eIndicator> const &indicator); +<i>IT</i> use(T & t, std::vector<indicator> const & ind); template <typename T, typename T1> -<i>IT</i> use(T &t, std::vector<eIndicator> const &ind, T1 p1); +<i>IT</i> use(T & t, std::vector<indicator> const & ind, T1 p1); </pre> <p>Example:</p> @@ -206,203 +291,201 @@ sql << "insert into numbers(val) values(:val)", use(val); <p>See <a href="exchange.html#bind_local">Binding local data</a> for more examples.</p> -<h3 id="statement">class Statement</h3> +<h3 id="statement">class statement</h3> -<p>The <code>Statement</code> class encapsulates the prepared statement.</p> +<p>The <code>statement</code> class encapsulates the prepared statement.</p> <pre class="example"> -class Statement +class statement { public: - Statement(Session &s); - Statement(<i>IT</i> const &prep); - ~Statement(); + statement(session & s); + statement(<i>IT</i> const & prep); + ~statement(); + + statement(statement const & other); + void operator=(statement const & other); void alloc(); - void bind(Values& values); - void exchange(<i>IT</i> const &i); // for into - void exchange(<i>IT</i> const &u); // for use - void cleanUp(); + void bind(values & v); + void exchange(<i>IT</i> const & i); + void exchange(<i>IT</i> const & u); + void clean_up(); - void prepare(std::string const &query); - void defineAndBind(); + void prepare(std::string const & query); + void define_and_bind(); bool execute(bool withDataExchange = false); bool fetch(); - void describe(); - void setRow(Row* r); + bool got_data() const; - details::StatementBackEnd * getBackEnd(); + void describe(); + void set_row(row * r); + void exchange_for_rowset(<i>IT</i> const & i); - Session &session_; + details::statement_backend * get_backend(); }; </pre> <p>This class contains the following members:</p> <ul> - <li>Constructor accepting the <code>Session</code> object. This can + <li>Constructor accepting the <code>session</code> object. This can be used for later query preparation. Example: <pre class="example"> -Statement stmt(sql); +statement stmt(sql); </pre> </li> <li>Constructor accepting the result of using <code>prepare</code> -on the <code>Session</code> object, see example provided above for the - <code>Session</code> class.</li> - <li><code>alloc</code> function, which allocates necessary resources. -This is normally called automatically.</li> - <li><code>bind</code> function, which is used to bind the Values +on the <code>session</code> object, see example provided above for the + <code>session</code> class.</li> + <li>Copy operations.</li> + <li><code>alloc</code> function, which allocates necessary internal resources.</li> + <li><code>bind</code> function, which is used to bind the <code>values</code> object - this is used in the object-relational mapping and normally called automatically.</li> <li>exchange functions for registering the binding of local data - they expect the result of calling the <code>into</code> or <code>use</code> functions and are normally invoked automatically.</li> - <li><code>cleanUp</code> function for cleaning up resources, normally + <li><code>clean_up</code> function for cleaning up resources, normally called automatically.</li> <li><code>prepare</code> function for preparing the statement for repeated execution.</li> - <li><code>defineAndBind</code> function for actually executing the -registered bindings, normally called automatically. - </li> + <li><code>define_and_bind</code> function for actually executing the +registered bindings, normally called automatically.</li> <li><code>execute</code> function for executing the statement. If its parameter is <code>false</code> then there is no data exchange with locally bound variables (this form should be used if later <code>fetch</code> -of multiple rows is foreseen).</li> +of multiple rows is foreseen). Returns <code>true</code> if there was at least +one row of data returned.</li> <li><code>fetch</code> function for retrieving the next portion of -the result.</li> +the result. Returns <code>true</code> if there was new data.</li> +<li><code>got_data</code> return <code>true</code> if the most recent +execution returned any rows.</li> <li><code>describe</code> function for extracting the type -information for the result (but no data is exchanged). This is normally +information for the result (note: no data is exchanged). This is normally called automatically and only when dynamic resultset binding is used.</li> - <li><code>setRow</code> function for associating the <code>Statement</code> -and <code>Row</code> objects, normally called automatically.</li> - <li><code>getBackEnd</code> function that returns the internal + <li><code>set_row</code> function for associating the <code>statement</code> +and <code>row</code> objects, normally called automatically.</li> + <li><code>exchange_for_rowset</code> as a special case for binding <code>rowset</code> +objects.</li> + <li><code>get_backend</code> function that returns the internal pointer to the concrete backend implementation of the statement object. This is provided for advanced users that need access to the functionality that is not otherwise available.</li> - <li><code>session_</code> reference to the "parent" <code>Session</code> -object that was used to create this object.</li> </ul> -<p>Most of the functions from the <code>Statement</code> class -interface are called automatically, but can be also used explicitly. -Example:</p> - -<pre class="example"> -Statement stmt(sql); -stmt.alloc(); -stmt.prepare("select count(*) from persons"); -int count; -stmt.exchange(into(count)); // repeat for all variables if there are more -stmt.defineAndBind(); -stmt.execute(true); // or execute() followed by fetch() -stmt.cleanUp(); // optional, destructor will do this anyway -</pre> - <p>See <a href="statements.html#preparation">Statement preparation and repeated execution</a> for example uses.</p> -<h3 id="procedure">class Procedure</h3> +<p>Most of the functions from the <code>statement</code> class +interface are called automatically, but can be also used explicitly. +See <a href="interfaces">Interfaces</a> for the description of various way to use +this interface.</p> + +<h3 id="procedure">class procedure</h3> -<p>The <code>Procedure</code> class encapsulates the call to the stored -procedure. It provides the same public interface as the <code>Statement</code> -class, but automatically adds the necessary "decorations" to the SQL -call (when they are required) for higher portability of the client code.</p> +<p>The <code>procedure</code> class encapsulates the call to the stored +procedure and is aimed for higher portability of the client code.</p> <pre class="example"> -class Procedure : public Statement +class procedure { public: - Procedure(Session &s); - Procedure(<i>IT</i> const &prep); + procedure(<i>IT</i> const & prep); + + bool execute(bool withDataExchange = false); + bool fetch(); + bool got_data() const; }; </pre> -<p>The second constructor above expects the result of using <code>prepare</code> -on the <code>Session</code> object.</p> +<p>The constructor expects the result of using <code>prepare</code> +on the <code>session</code> object.</p> <p>See <a href="statements.html#procedures">Stored procedures</a> for examples.</p> -<h3 id="typeconversion">class TypeConversion</h3> +<h3 id="typeconversion">class type_conversion</h3> -<p>The <code>TypeConversion</code> class is a traits class that is +<p>The <code>type_conversion</code> class is a traits class that is supposed to be provided (specialized) by the user for defining conversions to and from one of the basic SOCI types.</p> <pre class="example"> -template <class T> -struct TypeConversion +template <typename T> +struct type_conversion { - typedef <i>SomeBasicType</i> base_type; - static T from(<i>SomeBasicType</i> &t); - static <i>SomeBasicType</i> to(T &t); + typedef T base_type; + + static void from_base(base_type const & in, indicator ind, T & out); + + static void to_base(T const & in, base_type & out, indicator & ind); }; </pre> -<p>Users are supposed to properly implement the <code>from</code> and <code>to</code> +<p>Users are supposed to properly implement the <code>from_base</code> and <code>to_base</code> functions in their specializations of this template class.</p> <p>See <a href="exchange.html#custom_types">Extending SOCI to support custom (user-defined) C++ types</a>.</p> -<h3 id="row">class Row</h3> +<h3 id="row">class row</h3> -<p>The <code>Row</code> class encapsulates the data and type information +<p>The <code>row</code> class encapsulates the data and type information retrieved for the single row when the dynamic rowset binding is used.</p> <pre class="example"> -class Row +class row { public: - Row(); - ~Row(); + row(); + ~row(); - void addProperties(ColumnProperties const &cp); - std::size_t size() const; + void uppercase_column_names(bool forceToUpper); - eIndicator indicator(std::size_t pos) const; - eIndicator indicator(std::string const &name) const; + std::size_t size() const; - template <typename T> - void addHolder(T* t, eIndicator* ind); + indicator get_indicator(std::size_t pos) const; + indicator get_indicator(std::string const & name) const; - ColumnProperties const & getProperties (std::size_t pos) const; - ColumnProperties const & getProperties (std::string const &name) const; + column_properties const & get_properties (std::size_t pos) const; + column_properties const & get_properties (std::string const & name) const; template <typename T> T get(std::size_t pos) const; template <typename T> - T get(std::size_t pos, T const &nullValue) const; + T get(std::size_t pos, T const & nullValue) const; template <typename T> - T get(std::string const &name) const; + T get(std::string const & name) const; template <typename T> - T get(std::string const &name, T const &nullValue) const; + T get(std::string const & name, T const & nullValue) const; template <typename T> - Row const & operator>>(T &value) const; + row const & operator>>(T & value) const; + + void skip(std::size_t num = 1) const; + + void reset_get_counter() const }; </pre> <p>This class contains the following members:</p> <ul> - <li>Default constructor that allows to declare a <code>Row</code> + <li>Default constructor that allows to declare a <code>row</code> variable.</li> - <li><code>addProperties</code> function for associating the <code>ColumnProperties</code> -object with the <code>Row</code>, called automatically.</li> + <li><code>uppercase_column_names</code> - see the same function in the <code>session</code> class.</li> <li><code>size</code> function that returns the number of columns in the row.</li> - <li><code>indicator</code> function that returns the indicator value + <li><code>get_indicator</code> function that returns the indicator value for the given column (column is specified by position - starting from 0 - or by name).</li> - <li><code>addHolder</code> function that adds new holder object that -registers the given object for later bind, called automatically.</li> - <li><code>getProperties</code> function that returns the properties + <li><code>get_properties</code> function that returns the properties of the column given by position (starting from 0) or by name.</li> <li><code>get</code> functions that return the value of the column given by position or name. If the column contains null, then these @@ -412,112 +495,117 @@ or throw an exception.</li> extraction interface. Subsequent calls to this function are equivalent to calling <code>get</code> with increasing position parameter, starting from the beginning.</li> + <li><code>skip</code> and <code>reset_get_counter</code> allow to change the +order of data extraction for the above operator.</li> </ul> <p>See <a href="exchange.html#dynamic">Dynamic resultset binding</a> for examples.</p> -<h3 id="columnproperties">class ColumnProperties</h3> +<h3 id="columnproperties">class column_properties</h3> -<p>The <code>ColumnProperties</code> class provides the type and name +<p>The <code>column_properties</code> class provides the type and name information about the particular column in a rowset.</p> <pre class="example"> -enum eDataType { eString, eChar, eDate, eDouble, eInteger, eUnsignedLong }; - -class ColumnProperties +class column_properties { public: - std::string getName() const; - eDataType getDataType() const; + std::string get_name() const; + data_type get_data_type() const; }; </pre> <p>This class contains the following members:</p> <ul> - <li><code>getName</code> function that returns the name of the column.</li> - <li><code>getDataType</code> that returns the type of the column.</li> + <li><code>get_name</code> function that returns the name of the column.</li> + <li><code>get_data_type</code> that returns the type of the column.</li> </ul> <p>See <a href="exchange.html#dynamic">Dynamic resultset binding</a> for examples.</p> -<h3 id="values">class Values</h3> +<h3 id="values">class values</h3> -<p>The <code>Values</code> class encapsulates the data and type +<p>The <code>values</code> class encapsulates the data and type information and is used for object-relational mapping.</p> <pre class="example"> -class Values +class values { public: - Values(); + values(); + + void uppercase_column_names(bool forceToUpper); - eIndicator indicator(std::size_t pos) const; - eIndicator indicator(std::string const &name) const; + indicator get_indicator(std::size_t pos) const; + indicator get_indicator(std::string const & name) const; template <typename T> T get(std::size_t pos) const; template <typename T> - T get(std::size_t pos, T const &nullValue) const; + T get(std::size_t pos, T const & nullValue) const; + + template <typename T> + T get(std::string const & name) const; + + template <typename T> + T get(std::string const & name, T const & nullValue) const; template <typename T> - T get(std::string const &name) const; + values const & operator>>(T & value) const; + void skip(std::size_t num = 1) const; + void reset_get_counter() const; + template <typename T> - T get(std::string const &name, T const &nullValue) const; + void set(std::string const & name, T const & value, indicator indic = i_ok); template <typename T> - Values const & operator>>(T &value) const; + void set(const T & value, indicator indic = i_ok); template <typename T> - void set(std::string const &name, T &value, eIndicator indicator=eOK); + values & operator<<(T const & value); }; </pre> -<p>This class contains the following members:</p> +<p>This class contains the same members as the <code>row</code> class (with the same meaning) +plus:</p> <ul> - <li><code>indicator</code> functions with the same meaning as in the <code>Row</code> -class.</li> - <li><code>get</code> functions with the same meaning as in the <code>Row</code> -class.</li> - <li><code>operator>></code> for convenience stream-like -extraction interface. Subsequent calls to this function are equivalent -to calling <code>get</code> with increasing position parameter, -starting from the beginning.</li> - <li><code>set</code> function for storing values in named columns.</li> + <li><code>set</code> function for storing values in named columns or in subsequent positions.</li> + <li><code>operator<<</code> for convenience.</li> </ul> <p>See <a href="exchange.html#object_relational">Object-relational mapping</a> for examples.</p> -<h3 id="blob">class BLOB</h3> +<h3 id="blob">class blob</h3> -<p>The <code>BLOB</code> class encapsulates the "large object" +<p>The <code>blob</code> class encapsulates the "large object" functionality.</p> <pre class="example"> -class BLOB +class blob { public: - BLOB(Session &s); - ~BLOB(); + explicit blob(session & s); + ~blob(); std::size_t getLen(); - std::size_t read(std::size_t offset, char *buf, std::size_t toRead); - std::size_t write(std::size_t offset, char const *buf, std::size_t toWrite); - std::size_t append(char const *buf, std::size_t toWrite); + std::size_t read(std::size_t offset, char * buf, std::size_t toRead); + std::size_t write(std::size_t offset, char const * buf, std::size_t toWrite); + std::size_t append(char const * buf, std::size_t toWrite); void trim(std::size_t newLen); - details::BLOBBackEnd * getBackEnd(); + details::blob_backend * get_backend(); }; </pre> <p>This class contains the following members:</p> <ul> - <li>Constructor associating the BLOB object with the Session object.</li> - <li><code>getLen</code> function that returns the size of the BLOB + <li>Constructor associating the <code>blob</code> object with the <code>session</code> object.</li> + <li><code>get_len</code> function that returns the size of the BLOB object.</li> <li><code>read</code> function that reads the BLOB data into provided buffer.</li> @@ -527,7 +615,7 @@ provided buffer.</li> data.</li> <li><code>trim</code> function that truncates the existing data to the new length.</li> - <li><code>getBackEnd</code> function that returns the internal + <li><code>get_backend</code> function that returns the internal pointer to the concrete backend implementation of the BLOB object. This is provided @@ -538,59 +626,243 @@ otherwise available.</li> <p>See <a href="exchange.html#blob">Large objects (BLOBs)</a> for more discussion.</p> -<h3 id="rowid">class RowID</h3> +<h3 id="rowid">class rowid</h3> -<p>The <code>RowID</code> class encapsulates the "row identifier" object.</p> +<p>The <code>rowid</code> class encapsulates the "row identifier" object.</p> <pre class="example"> -class RowID +class rowid { public: - RowID(Session &s); - ~RowID(); + explicit rowid(Session & s); + ~rowid(); - details::RowIDBackEnd * getBackEnd(); + details::rowid_backend * get_backend(); }; </pre> <p>This class contains the following members:</p> <ul> - <li>Constructor associating the <code>RowID</code> object with the <code>Session</code> + <li>Constructor associating the <code>rowid</code> object with the <code>session</code> object.</li> - <li><code>getBackEnd</code> function that returns the internal + <li><code>get_backend</code> function that returns the internal pointer to -the concrete backend implementation of the <code>RowID</code> object.</li> +the concrete backend implementation of the <code>rowid</code> object.</li> </ul> -<h3 id="backendfactory">class BackEndFactory</h3> +<h3 id="backendfactory">class backend_factory</h3> -<p>The <code>BackEndFactory</code> class provides the abstract interface +<p>The <code>backend_factory</code> class provides the abstract interface for concrete backend factories.</p> <pre class="example"> -struct BackEndFactory +struct backend_factory { - virtual details::SessionBackEnd * makeSession( - std::string const &connectString) const = 0; + virtual details::session_backend * make_session( + std::string const & connectString) const = 0; }; </pre> -<p>The only member of this class is the <code>makeSession</code> function +<p>The only member of this class is the <code>make_session</code> function that is supposed to create concrete backend implementation of the session object.</p> <p>Objects of this type are declared by each backend and should be -provided to the constructor of the <code>Session</code> class. +provided to the constructor of the <code>session</code> class. In simple programs users do not need to use this class directly, but the example use is:</p> <pre class="example"> -BackEndFactory &factory = postgresql; +backend_factory & factory = postgresql; std::string connectionParameters = "dbname=mydb"; -Session sql(factory, parameters); +session sql(factory, parameters); </pre> +<h3 id="simpleclient">Simple client interface</h3> + +<p>The simple client interface is provided with other languages in mind, +to allow easy integration of the SOCI library with script interpreters and those +languages that have the ability to link directly with object files using +the "C" calling convention.</p> +<p>The functionality of this interface is limited and in particular the +dynamic rowset description and type conversions are not supported in this release. +On the other hand, the important feature of this interface is that it does not +require passing pointers to data managed by the user, because all data is handled +at the SOCI side. This should make it easier to integrate SOCI with languages that +have constrained ability to understand the C type system.</p> +<p>Users of this interface need to explicitly <code>#include <soci-simple.h></code>.</p> + +<pre class="example"> +typedef void * session_handle; +session_handle soci_create_session(char const * connectionString); +void soci_destroy_session(session_handle s); + +void soci_begin(session_handle s); +void soci_commit(session_handle s); +void soci_rollback(session_handle s); + +int soci_session_state(session_handle s); +char const * soci_session_error_message(session_handle s); +</pre> + +<p>The functions above provide the <i>session</i> abstraction with the help of opaque handle. +The <code>soci_session_state</code> function returns <code>1</code> if there was no error +during the most recently executed function and <code>0</code> otherwise, in which +case the <code>soci_session_error_message</code> can be used to obtain a human-readable +error description.</p> +<p>Note that the only function that cannot report all errors this way is <code>soci_create_session</code>, +which returns <code>NULL</code> if it was not possible to create an internal object +representing the session. However, if the proxy object was created, but the connection +could not be established for whatever reason, the error message can be obtained in +the regular way.</p> + +<pre class="example"> +typedef void * statement_handle; +statement_handle soci_create_statement(session_handle s); +void soci_destroy_statement(statement_handle st); + +int soci_statement_state(statement_handle s); +char const * soci_statement_error_message(statement_handle s); +</pre> + +<p>The functions above create and destroy the statement object. If the statement cannot +be created by the <code>soci_create_statement</code> function, the error condition is set up in the related session object; +for all other functions the error condition is set in the statement object itself.</p> + +<pre class="example"> +int soci_into_string (statement_handle st); +int soci_into_int (statement_handle st); +int soci_into_long_long(statement_handle st); +int soci_into_double (statement_handle st); +int soci_into_date (statement_handle st); + +int soci_into_string_v (statement_handle st); +int soci_into_int_v (statement_handle st); +int soci_into_long_long_v(statement_handle st); +int soci_into_double_v (statement_handle st); +int soci_into_date_v (statement_handle st); +</pre> + +<p>These functions create new data items for storing query results (<i>into elements</i>). +These elements can be later identified by their position, which is counted from 0. For convenience, +these function return the position of the currently added element. In case of error, +<code>-1</code> is returned and the error condition is set in the statement object.</p> +<p>The <code>_v</code> versions create a <code>vector</code> into elements, which can be used +to retrieve whole arrays of results.</p> + +<pre class="example"> +int soci_get_into_state(statement_handle st, int position); +int soci_get_into_state_v(statement_handle st, int position, int index); +</pre> + +<p>This function returns <code>1</code> if the into element at the given position has non-null value and <code>0</code> otherwise. +The <code>_v</code> version works with <code>vector</code> elements and expects an array index.</p> + +<pre class="example"> +int soci_into_get_size_v(statement_handle st); +void soci_into_resize_v (statement_handle st, int new_size); +</pre> + +<p>The functions above allow to get and set the size of vector into element.</p> + +<p>Note: the <code>soci_into_resize_v</code> always sets <i>all</i> into vectors in the given statement +to the same size, which guarantees that all vector into elements have equal size.</p> + +<pre class="example"> +char const * soci_get_into_string (statement_handle st, int position); +int soci_get_into_int (statement_handle st, int position); +long long soci_get_into_long_long(statement_handle st, int position); +double soci_get_into_double (statement_handle st, int position); +char const * soci_get_into_date (statement_handle st, int position); + +char const * soci_get_into_string_v (statement_handle st, int position, int index); +int soci_get_into_int_v (statement_handle st, int position, int index); +long long soci_get_into_long_long_v(statement_handle st, int position, int index); +double soci_get_into_double_v (statement_handle st, int position, int index); +char const * soci_get_into_date_v (statement_handle st, int position, int index); +</pre> + +<p>The functions above allow to retrieve the current value of the given into element.</p> + +<p>Note: the <code>date</code> function returns the date value in the "<code>YYYY MM DD HH mm ss</code>" string format.</p> + +<pre class="example"> +void soci_use_string (statement_handle st, char const * name); +void soci_use_int (statement_handle st, char const * name); +void soci_use_long_long(statement_handle st, char const * name); +void soci_use_double (statement_handle st, char const * name); +void soci_use_date (statement_handle st, char const * name); + +void soci_use_string_v (statement_handle st, char const * name); +void soci_use_int_v (statement_handle st, char const * name); +void soci_use_long_long_v(statement_handle st, char const * name); +void soci_use_double_v (statement_handle st, char const * name); +void soci_use_date_v (statement_handle st, char const * name); +</pre> + +<p>The functions above allow to create new data elements that will be used to provide +data to the query (<i>use elements</i>). The new elements can be later identified by given name, which +must be unique for the given statement.</p> + +<pre class="example"> +void soci_set_use_state(statement_handle st, char const * name, int state); +</pre> + +<p>The <code>soci_set_use_state</code> function allows to set the state of the given use element. +If the <code>state</code> parameter is set to non-zero the use element is considered non-null +(which is also the default state after creating the use element).</p> + +<pre class="example"> +int soci_use_get_size_v(statement_handle st); +void soci_use_resize_v (statement_handle st, int new_size); +</pre> + +<p>These functions get and set the size of vector use elements (see comments for vector into elements above).</p> + +<pre class="example"> +void soci_set_use_string (statement_handle st, char const * name, char const * val); +void soci_set_use_int (statement_handle st, char const * name, int val); +void soci_set_use_long_long(statement_handle st, char const * name, long long val); +void soci_set_use_double (statement_handle st, char const * name, double val); +void soci_set_use_date (statement_handle st, char const * name, char const * val); + +void soci_set_use_state_v (statement_handle st, char const * name, int index, int state); +void soci_set_use_string_v (statement_handle st, char const * name, int index, char const * val); +void soci_set_use_int_v (statement_handle st, char const * name, int index, int val); +void soci_set_use_long_long_v(statement_handle st, char const * name, int index, long long val); +void soci_set_use_double_v (statement_handle st, char const * name, int index, double val); +void soci_set_use_date_v (statement_handle st, char const * name, int index, char const * val); +</pre> + +<p>The functions above set the value of the given use element, for both single and vector elements.</p> + +<p>Note: the expected format for the data values is "<code>YYYY MM DD HH mm ss</code>".</p> + +<pre class="example"> +int soci_get_use_state (statement_handle st, char const * name); +char const * soci_get_use_string (statement_handle st, char const * name); +int soci_get_use_int (statement_handle st, char const * name); +long long soci_get_use_long_long(statement_handle st, char const * name); +double soci_get_use_double (statement_handle st, char const * name); +char const * soci_get_use_date (statement_handle st, char const * name); +</pre> + +<p>These functions allow to inspect the state and value of named use elements.</p> +<p>Note: these functions are provide only for single use elements, not for vectors; +the rationale for this is that modifiable use elements are not supported for bulk operations.</p> + +<pre class="example"> +void soci_prepare(statement_handle st, char const * query); +int soci_execute(statement_handle st, int withDataExchange); +int soci_fetch(statement_handle st); +int soci_got_data(statement_handle st); +</pre> + +<p>The functions above provide the core execution functionality for the statement object +and their meaning is equivalent to the respective functions in the core C++ interface +described above.</p> + <table class="foot-links" border="0" cellpadding="2" cellspacing="2"> <tr> <td class="foot-link-left"> diff --git a/doc/statements.html b/doc/statements.html index 1a4fe874..3bf9e091 100644 --- a/doc/statements.html +++ b/doc/statements.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -48,15 +48,15 @@ are likely to optimize the second case. In fact, more complicated queries are likely to suffer in terms of lower performance, because finding the optimal execution plan is quite expensive and here it would be needlessly repeated.</p> -<p>The following example uses the class <code>Statement</code> +<p>The following example uses the class <code>statement</code> explicitly, by preparing the statement only once and repeating its execution with changing data (note the use of <code>prepare</code> -member of <code>Session</code> class):</p> +member of <code>session</code> class):</p> <pre class="example"> int i; -Statement st = (sql.prepare << +statement st = (sql.prepare << "insert into numbers(value) values(:val)", use(i)); for (i = 0; i != 100; ++i) @@ -83,35 +83,35 @@ to fall back to this one-phase behaviour.</p> <h3 id="rowset">Rowset and iterator-based access</h3> -<p>The <code>Rowset</code> class provides an alternative means of executing queries and accessing results using STL-like iterator interface.</p> +<p>The <code>rowset</code> class provides an alternative means of executing queries and accessing results using STL-like iterator interface.</p> -<p>The <code>rowset_iterator</code> type is compatible with requirements defined for input iterator category and is available via <code>iterator</code> and <code>const_iterator</code> definitions in the <code>Rowset</code> class.</p> -<p>The <code>Rowset</code> itself can be used only with select queries.</p> +<p>The <code>rowset_iterator</code> type is compatible with requirements defined for input iterator category and is available via <code>iterator</code> and <code>const_iterator</code> definitions in the <code>rowset</code> class.</p> +<p>The <code>rowset</code> itself can be used only with select queries.</p> -<p>The following example creates an instance of the <code>Rowset</code> class and binds query results into elements of <code>int</code> type - in this query only one result column is expected. After executing the query the code iterates through the query result using <code>rowset_iterator</code>:</p> +<p>The following example creates an instance of the <code>rowset</code> class and binds query results into elements of <code>int</code> type - in this query only one result column is expected. After executing the query the code iterates through the query result using <code>rowset_iterator</code>:</p> <pre class="example"> -Rowset<int> rs = (sql.prepare << "select values from numbers"); +rowset<int> rs = (sql.prepare << "select values from numbers"); -for (Rowset<int>::const_iterator it = rs.begin(); it != rs.end(); ++it) +for (rowset<int>::const_iterator it = rs.begin(); it != rs.end(); ++it) { cout << *it << '\n'; } </pre> -<p>Another example presents how to retrieve more complex results, where <code>Rowset</code> elements are of type <code>Row</code> and therefore use <a href="exchange.html#dynamic">dynamic bindings</a>:</p> +<p>Another example shows how to retrieve more complex results, where <code>rowset</code> elements are of type <code>row</code> and therefore use <a href="exchange.html#dynamic">dynamic bindings</a>:</p> <pre class="example"> // person table has 4 columns -Rowset<Row> rs = (sql.prepare << "select id, firstname, lastname, gender from person"); +rowset<row> rs = (sql.prepare << "select id, firstname, lastname, gender from person"); // iteration through the resultset: -for (Rowset<Row>::const_iterator it = rs.begin(); it != rs.end(); ++it) +for (rowset<row>::const_iterator it = rs.begin(); it != rs.end(); ++it) { - Row const& row = (*it); + row const& row = *it; - // dynamic data extraction from each Row: + // dynamic data extraction from each row: cout << "Id: " << row.get<int>(0) << '\n' << "Name: " << row.get<string>(1) << " " << row.get<string>(2) << '\n' << "Gender: " << row.get<string>(3) << endl; @@ -121,12 +121,12 @@ for (Rowset<Row>::const_iterator it = rs.begin(); it != rs.end(); ++it) <p><code>rowset_iterator</code> can be used with standard algorithms as well:</p> <pre class="example"> -Rowset<string> rs = (sql.prepare << "select firstname from person"); +rowset<string> rs = (sql.prepare << "select firstname from person"); std::copy(rs.begin(), rs.end(), std::ostream_iterator<std::string>(std::cout, "\n")); </pre> -<p>Above, the query result contains a single column which is bound to <code>Rowset</code> element of type of <code>std::string</code>. All records are sent to standard output using the <code>std::copy</code> algorithm.</p> +<p>Above, the query result contains a single column which is bound to <code>rowset</code> element of type of <code>std::string</code>. All records are sent to standard output using the <code>std::copy</code> algorithm.</p> <h3 id="bulk">Bulk operations</h3> @@ -142,7 +142,7 @@ for (int i = 0; i != BATCH_SIZE; ++i) ids.push_back(i); } -Statement st = (sql.prepare << +statement st = (sql.prepare << "insert into numbers(value) values(:val)", use(valsIn)); for (int i = 0; i != 4; ++i) @@ -160,7 +160,7 @@ examples:</p> <pre class="example"> int i; -Statement st = (sql.prepare << +statement st = (sql.prepare << "select value from numbers order by value", into(i)); st.execute(); @@ -173,11 +173,11 @@ while (st.fetch()) <p>In the above example, the <code>execute</code> method is called with the default parameter <code>false</code>. This means that the statement should be executed, but the actual data exchange will be -executed later.</p> +performed later.</p> <p>Further <code>fetch</code> calls perform the actual data retrieval and cursor traversal. The -end-of-cursor condition is indicated by the <code>fetch</code> +<i>end-of-cursor</i> condition is indicated by the <code>fetch</code> function returning <code>false</code>.</p> <p>The above code example should be treated as an idiomatic way @@ -194,17 +194,17 @@ sql << "select val from numbers", into(valsOut); <p>Above, the value <code>100</code> indicates that no more values should be retrieved, even if it would be otherwise possible. If there -is less rows than asked for, the vector will be appropriately +are less rows than asked for, the vector will be appropriately down-sized.</p> -<p>The <code>Statement::execute()</code> and <code>Statement::fetch()</code> +<p>The <code>statement::execute()</code> and <code>statement::fetch()</code> functions can also be used to repeatedly select all rows returned by a query into a vector based type:</p> <pre class="example"> const int BATCH_SIZE = 30; std::vector<int> valsOut(BATCH_SIZE); -Statement st = (sql.prepare << +statement st = (sql.prepare << "select value from numbers", into(valsOut)); st.execute(); @@ -253,9 +253,9 @@ requested size.</p> <p><span class="note">Portability note:</span></p> <p>Actually, all supported backends guarantee that the requested number of rows will be read with each fetch and that the vector will -never be down-sized (unless the end of rowset condition is met, of -course). This means that the manual vector -resizing is not needed - the vector will keep its size until the end of +never be down-sized, unless for the last fetch, when the end of rowset condition is met. +This means that the manual vector +resizing is in practice not needed - the vector will keep its size until the end of rowset. The above idiom, however, is provided with future backends in mind, where the constant size of the vector might be too expensive to guarantee and where allowing <code>fetch</code> to down-size the @@ -265,7 +265,7 @@ performance gains.</p> <h3 id="procedures">Stored procedures</h3> -<p>The <code>Procedure</code> class provides a convenient mechanism for +<p>The <code>procedure</code> class provides a convenient mechanism for calling stored procedures:</p> <pre class="example"> @@ -275,7 +275,7 @@ sql << "create or replace procedure echo(output out varchar2," std::string in("my message"); std::string out; -Procedure proc = (sql.prepare << "echo(:output, :input)", +procedure proc = (sql.prepare << "echo(:output, :input)", use(out, "output"), use(in, "input")); proc.execute(true); @@ -292,7 +292,7 @@ database server.</p> <h3 id="transactions">Transactions</h3> -<p>The SOCI library provides the following members of the <code>Session</code> +<p>The SOCI library provides the following members of the <code>session</code> class for transaction management:</p> <ul> <li><code>void begin();</code></li> @@ -313,26 +313,26 @@ above functions for explicit transaction management.</p> <h3 id="logging">Basic logging support</h3> -<p>The following members of the <code>Session</code> class support the basic logging functionality:</p> +<p>The following members of the <code>session</code> class support the basic logging functionality:</p> <ul> - <li><code>void setLogStream(std::ostream *s);</code></li> - <li><code>std::ostream * getLogStream() const;</code></li> - <li><code>std::string getLastQuery() const;</code></li> + <li><code>void set_log_stream(std::ostream * s);</code></li> + <li><code>std::ostream * get_log_stream() const;</code></li> + <li><code>std::string get_last_query() const;</code></li> </ul> <p>The first two functions allow to set the user-provided output stream object for logging. The <code>NULL</code> value, which is the default, means that there is no logging. An example use might be:</p> <pre class="example"> -Session sql(oracle, "..."); +session sql(oracle, "..."); ofstream file("my_log.txt"); -sql.setLogStream(&file); +sql.set_log_stream(&file); // ... </pre> -<p>Each statement logs its query string before the preparation step (whether explicit or implicit) and the logging is effective whether the query succeeds or not. Note that each prepared query is logged only once, independent on how many times it is executed.</p> -<p>The <code>getLastQuery</code> function allows to retrieve the last used query.</p> +<p>Each statement logs its query string before the preparation step (whether explicit or implicit) and therefore logging is effective whether the query succeeds or not. Note that each prepared query is logged only once, independent on how many times it is executed.</p> +<p>The <code>get_last_query</code> function allows to retrieve the last used query.</p> <table class="foot-links" border="0" cellpadding="2" cellspacing="2"> <tr> @@ -340,11 +340,11 @@ sql.setLogStream(&file); <a href="exchange.html">Previous (Exchanging data)</a> </td> <td class="foot-link-right"> - <a href="beyond.html">Next (Beyond SOCI)</a> + <a href="multithreading.html">Next (Multithreading)</a> </td> </tr> </table> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/structure.html b/doc/structure.html index 4fba5b7b..f103b673 100644 --- a/doc/structure.html +++ b/doc/structure.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -15,7 +15,7 @@ <a href="#structure">Structure</a><br /> <a href="#compilation">Compilation</a><br /> <div class="navigation-indented"> - <a href="#autotools">With autotools on Unix/Linux</a><br /> + <a href="#script">With build script on Unix/Linux</a><br /> <a href="#makefiles">With classic Makefiles on Unix/Linux</a><br /> <a href="#msvc">With Microsoft Visual C++ 2005 on Windows</a> </div> @@ -27,31 +27,39 @@ <img alt="Library structure diagram" src="structure.png" /> </div> +<p>The picture above presents the structure of the library, together with its +clients and servers. The boxes filled with cyan represent components that +are part of the library distribution.</p> + +<p>The SOCI library is extensible in the following ways:</p> +<ul> + <li>More backends can be added to target various database servers.</li> + <li>More interfaces can be defined on top of common backend interface.</li> + <li>Other languages can use the <i>simple interface</i>, which was designed specifically + for the "C" calling convention to ensure easy binding.</li> +</ul> + <p>The core part of the library and the backend interface definition are placed in the <code>core</code> directory of the library distribution. The <code>soci-backend.h</code> file is an internal abstract interface to the actual backends, which are needed to perform operations on the given database server. Normally, the C++ client program needs to interface with the <code>soci.h</code> header and the -header(s) relevant to the given backend(s) (for example, <code>soci-oracle.h</code>). +header(s) relevant to the given backend(s) (for example, <code>soci-oracle.h</code>), +although with dynamic backend loading this can be avoided. It is possible for the same program to use many backends at the same time.</p> -<p>The gray boxes above indicate that the SOCI library is extensible and -that there are two aspects of this extensibility: more backends can be -added, and more interfaces (possibly for other languages) can be -defined to reuse the already existing backends.</p> - <p>Everything in SOCI is -declared in the namespace <code>SOCI</code>. +declared in the namespace <code>soci</code>. All code examples presented in this documentation assume that your code begins with something like:</p> <pre class="example"> #include "soci.h" -// other includes +// other includes if necessary -using namespace SOCI; +using namespace soci; // ... </pre> @@ -59,66 +67,95 @@ using namespace SOCI; <div class="note"> <p><span class="note">Note:</span> In simple programs, <code>#include</code> for the relevant -backend is needed only in the file where the <code>Session</code> -object is created, because it is where the name of the backend factory -is referenced. The example program on the <a href="index.html">previous +backend is needed only in the file where the <code>session</code> +object is created with explicit name of the backend factory. +The example program on the <a href="index.html">previous page</a> shows the appropriate <code>#include</code> directive for the -Oracle backend.</p> +Oracle backend. It is also possible to name backends at run-time +as part of the connection string, in which case no backend-specific +<code>#include</code> directive is necessary.</p> </div> <h3 id="compilation">Compilation</h3> <p>Download the SOCI distribution file: soci-X.Y.Z.tar.gz|tar.bz2|zip, where X.Y.Z is the version number. Unpack this file.</p> -<h4 id="autotools">With autotools on Unix/Linux</h4> +<h4 id="script">With build script on Unix/Linux</h4> -<p>Configure:</p> +<p>Short version:</p> <pre class="example"> $ ./configure +$ make +$ make install </pre> -<p>You may want to pass custom options to <code>./configure</code> script. -Backends can be enabled using options named as <code>--enable-backend-<name></code> and -disabled using <code>--disable-backend-<name></code>. -For example, to compile with support for MySQL that is already installed in some standard location, do this:</p> +<p>Long version:</p> + +<p>The <code>configure</code> script verifies that the Tcl interpreter is installed on the system, +as a dependency for all the build and install scripts, and allows to provide various +settings if the local environment differs from standard installations.</p> +<p>When the <code>configure</code> script is run without parameters, the remaining +part of the process will use <code>/usr/local/include/soci</code> as a default destination for SOCI header files +and <code>/usr/local/lib</code> as a default destination for library files and the build script +will try to find all supported database installations in the "usual" set of directories. +To build the Oracle backend, the <code>ORACLE_HOME</code> environment variable has to be set +properly as well.</p> + +<p>The configuration parameters allow to change the target directory for installing SOCI +and to name specific directories for chosen database header and library files if they are +not installed on any of the "usual" paths. +To learn about all configuration options run:</p> +<pre class="example"> +$ ./configure --help +</pre> +<p>For example, if the MySQL header and library files were installed locally in +<code>/opt/mysql/include</code> and <code>/opt/mysql/lib</code>, then the following +command will configure the build step accordingly:</p> <pre class="example"> -$ ./configure --enable-backend-mysql=yes +$ ./configure --mysql-include=/opt/mysql/include --mysql-lib=/opt/mysql/lib </pre> -<p>There are also <code>--with-<package></code> -options which can be used to tell the script where the required headers and libraries can be found.</p> -<p>For example, to compile the library with the Oracle backend that is itself installed on a separate filesystem the following might be needed (example broken into three lines for clarity):</p> +<p>After configuring the build and installation steps you can build the SOCI library by simply running <code>make</code>. +The core library and backends will be placed in <code>build/unix/include</code> and <code>build/unix/lib</code> directories.</p> +<p>The library can be installed by:</p> <pre class="example"> -$ ./configure --enable-backend-oracle=yes \ - --with-oracle-include=/u01/oracle/product/10.1.0/rdbms/public \ - --with-oracle-lib=/u01/oracle/product/10.1.0/lib +$ make install </pre> -<p>Run <code>./configure --help</code> to learn what configuration options are available.</p> - -<p>Build (after successful configuration):</p> +<p>Note: depending on the target directory it might be necessary to acquire root permissions before +installing the library.</p> +<p>The "undo" script that removes all files and directories +that were created during installation is created automatically and can be run by:</p> <pre class="example"> -$ make +$ make uninstall </pre> -<p>Installation:</p> +<p>In addition to the library itself, the test programs for each backend can be compiled as well:</p> <pre class="example"> -$ make install +$ make tests </pre> -<p>After the last step, SOCI components will be placed under default installation prefix <code>/usr/local</code> or custom location, if specified using <code>--prefix</code> option.</p> +<p>The compiled test programs are located in <code>build/unix/tests</code> and require, as their single parameter, +a connection string understood by the relevant backend. Run them without arguments to see the usage description.</p> + +<p>All build artefacts (not counting the installed files) can be removed with the following:</p> +<pre class="example"> +$ make clean +</pre> <h4 id="makefiles">With classic Makefiles on Unix/Linux</h4> -<p>The classic set of Makefiles for Unix/Linux systems is provided just in case if the autotools method fails to recognize the local system configuration. In this sense, the Makefiles are supposed to only provide a minimal starting point for custom experimentation and are not intended to be a complete build/installation solution.<br /> -On the other hand, they are complete in the sense that they can compile the library with all test programs and for some users this level of support will be just fine.</p> +<p>The classic set of Makefiles for Unix/Linux systems is provided for those users who need complete control over the whole process +and who can benefit from the basic scaffolding that they can extend on their own. +In this sense, the basic Makefiles are supposed to provide a minimal starting point for custom experimentation and are not intended to be a complete build/installation solution.<br /> +At the same time, they are complete in the sense that they can compile the library with all test programs and for some users this level of support will be just fine.</p> <p>The <code>core</code> directory of the library distribution contains the <code>Makefile.basic</code> that can be used to compile the core part of -the library. Run <code>make -f Makefile.basic</code> or <code>make -f Makefile.basic shared</code> to get -the static and shared versions. Similarly, the <code>backends/<i>name</i></code> directory contains the +the library. Run <code>make -f Makefile.basic</code> or <code>make -f Makefile.basic shared</code> to get the static and shared versions, respectively. +Similarly, the <code>backends/<i>name</i></code> directory contains the backend part for each supported backend with the appropriate <code>Makefile.basic</code> and the <code>backends/<i>name</i>/test</code> directory contains the test program for the given backend.</p> @@ -139,7 +176,8 @@ $ make -f Makefile.basic <p><span class="note">Note:</span> For each backend and its test program, the <code>Makefile.basic</code>s contain the variables that can have values specific to the given -environment. These variables are placed at the beginning of the <code>Makefile.basic</code>s. +environment - they usually name the include and library paths. +These variables are placed at the beginning of the <code>Makefile.basic</code>s. Please review their values in case of any compilation problems.</p> </div> @@ -225,6 +263,6 @@ It is also possible to run test programs directly from command prompt, without u </tr> </table> -<p class="copyright">Copyright © 2004-2006 Maciej Sobczak, Stephen Hutton</p> +<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> </body> </html> diff --git a/doc/structure.png b/doc/structure.png index 0e698fbc576b113c912214efe1bb2a95767f4046..1694cb68715464bd7e21004cb38f1e3dca9f47af 100644 GIT binary patch literal 26919 zcmeAS@N?(olHy`uVBq!ia0y~yV0^^Dz&L}0iGhJJ&D8BE0|NtRfk$L90|Vb#1_r(} zj8%WH-ezFPxasNQ7*a9k&0gLZk?VW^|GzoEyXoX42Nz+_rmm<Hy56nXAJh~bO?DRi z7S1r;+Vre_*)EfM?paF$dT)s7ip^$uxNPT|%!ASgt{vO5!2IZKjx`r&XGMEN+<Ng< zb4HuVRhHmwye=oQ{}rdDm8Z)$uzoB2_Pg$7!M8J&^WN7yKQpI&{jA3pQ@vUX4;|mM zLtU~qX~oYN^$A@z*Pd`2GG4iN{*tc8(|y-!jkNy7SG0Ss4J*B#ajkCiqIK&nG!I=_ z%YR*rAyel1x$TARozVrxCdx~e`iF=vShnb0cFmE42NUn9n@m}HUg=x0r?Ts8pPh?^ zf?V0XZ5B4X)|ybK_QJwXeb@0R?6K1=SL{5Z=Qf9dQCq#J_R+4qk9+MldZ#WCaSyca zx}=_DtG+BH_8{-mGCkFrg}Uy?Cr>_CvgxVZ_Ke+~4Oi9kykB0DJmYonY>~cjh;^f$ zf=tZh+eShK@jH`)W%ign(7HQqpYA~|b-RGOOkH{JIc-kX{<*WUB*q{v^zEnO=SMn) zAA8MszOY?RYVDmhGi~pDf3Vp=g6DDX(eTnmpU#HAERj!}bNr9*gIx>!+t>B}ET26= zVV^>b`y>4eOQlUkt9zc?U(%a%(E8l|U8N6Cow~nwO4;kE!-ovi71g8iURo{L;Pm-J ztK5@#u>?I6|05OLXAg`2S}GoQcSogae8#`$d!>1mTT9yQDi@0hI%n9oEGnB~`uO%r zj@}ssNxkj<_x_wvep#L{&8;~3!Fuuk&!?)F$(K!0EuZrHAn%(Q3!ESBSp4bMv3L7S zB)&!72|k>5cXQ3=#Gh%qBQi5H7f-!yt<SQjNFrZkUqV;iyPnS5^No_#Ufe29_i?K| z<<qiJF50f{oe$5xgoC>G%~o8xsBdGv)ct}%h+@XugYwrGcl@8pxNb&e_;PN0^&eVK z8jFf^zeRQ&nszU3@dNJLY75?{cCx7@+mx$a`23A2*}lBy6Yp8kHBY~Nk?yJv7TdSF z+i$zQ^_znDQ*$i#J)X}$J&<G7^K*`}KH?uFH!M8+EA*|G`Litx_DhIYJpJn)@=xyT zSBW=ATJLYJt4!beMEQ{YjGj`Dj)P&M*S048HM;UuF|%g9)MNefb@w{ceVBHzJoE5+ zE^i><EitR5MdjdTfv=kmOk)pTsxUuRc;cmoslxkfcl0!Ux%2UM`)Li9HFJLKVh~Pg z`pi}19bj9&Zf?lg8i5n<p3bsc<L94O)suaiJ-hkK>X>Me>b;H~T6>pm^_o6!!n&ZX z$(qNvt~_J+ETnDex`|oY?)9lf6;|p0w>|t;<i0fONmf~+bb4L-#*{VFcHUl793m6f zr1IY@J^i>^!qXI{^RoMAhdlTz<kQeFMPTIxzjWbFslRs`=lF-4&Rrezeezu1T;=Vn zSGfJlaVpyJYSl;H<&)>$iOE<V-09*TWA|HZa!Azt=&1JsvYR4&_+2t{SdQf_n>?Fa zHp1hRL6w3v@8kGe$xNU7+%y~G&%ZA0a=&kBW41E=Nny(U^DeU(R(VdhPT1OBePe3# zCAE^*k=Av;43^0sZ#r7>Tv$avIX$|1g52YEYwm=<2uie3IB1k1dz#Pl!;$Md7l`x+ z&NBS)WsAGy?hC@dE#7Z#KfPq%nSLWr&#?cTKITpNM-J=CF8in`pDa*ne7?Zksg7-N zU+v5`1HGslY{DPTsV+IPYhGE@t!rY=sWYC`{XBVV{r3G=KfgKE8mtzbQEB~E*Hk_E zUxRK?hTI2P|IUMHdpEr2+Pm!hV$<Mfy1#U??_F6_$t~OL>u2-Lbm1lr^{)|oBvSp8 z{jIh97T+kG_1eP1z9IbI>nq0Da;w(fsaX8|hjQiayS7I=veS=;Jk*T1*Y?R%Rc(_2 zPfe%m_bV@+vK=luZm_uT^R79UTjnb(`|3&AI@;In=()#|r@iI2{4L=*VJ3acPqIAQ zy=%fV56)jJD|+}uqh=|vn9cT><8@^JiHztQH4E2jnTgF>(IjY47*M`xWAMgc(|^;Y zwu{{=EED*zq^$RNv;1Dswkq|i$69_i7X0Pi>TV0pDQuc)_hg~X9Xmr$-Tx9?{A**2 zzpqg_dbgwQ^bhW{_WF<BH~;e6#*q|I;l^+&nJKzptB`T%3)w?Crk~%eI2dcSy8ncg zXxHz;wfv{QZEUTMk)B;BGT9)g?VUzRQ_j}5h@=~KYC3uD?H+r71aHgAw^4Ol(A8dV z=je8D^W~No(erra=43qH$-Uy+`Flq-SY8Fq?-Yqz>J{JhZO*lMhrY}xnfmJHs-^!c z7Cf9g;e_+s_gh4b&dv?4-IRIRcU8S{Ueu*s_5Bkc@6xe*q_SxG_ht2}#icvGW%(cf z`(9DcG;`Z=Zr%BZlV?t!!1Y3CNxE;a;_Y26*^ld=y*~Z6MxtMI`@uhFW*+zun9$Xp zpMS(*j*3O%9xK&LhU*_>W}L`BR@@vRyX@7hjHjWimd^QcGD^XHX;x9Twcn<Se+^sL zK6YxKdnKhp;8j4iz2dCQ0txZDF4kQiHpuj43rYX__4T!&pwz!TH!d7H-{~j1`E1pm zqo19xDDTj%`)0ba<#Nlaqu~aA+w?B3OI5#j!EcjX{Kr26>+PgvKXa{1U!1?0e_q?M z8QvF<-xiCTeA!`-;-9dcnga6MzaH6tq4)pdz31OEP0D`%ust`|>71R(6enelcSqCC zoNxPRzv0{LO9mg7DxXQ${orF<CAR1Zr^M}xLClY3GtQ(X{wWRICBJPeoA1&$>u<!( zy*laeCOK8J)3>G+I<);Xj$jKo6RG@5zV61gZ7RM=_9FI&um8<npL^pKd)LwLMYikM z1dfa8c5gd&@#wcw=fm>1s$zC*GTwGyC?Qw&g3pGv?swiCFWxQcYo)xr{NRzWXrBhd zZSzW`r*ThSk@WYzpYV)YwuSO%%isIO9d0&0`1Nsu{-;NQ(|V7jq)heN_{5##_TP-# zkxH*GMQ*Qhy8Z0LDbrhRTlQCf-8p-DZlzMXq<mYx=7v_@J;}`n1Ad?UDXc4hcj^6o ziJ|wpj+@&}ojFadO;XkL-<0rMw~E+1e3c~+3H-X4q};_=^mxK+gTEb{-x@`;O?`cQ zuk(?Lo#ju11#X=v5|P>Z=i{|j{<V=EreXfG4U``S*RGA?dK~%eg<aFT%Q>6@&zF15 z?E75rT*mqNepve%{p4?{>AyEscW&9Dd*F|Hw*3AN$KScX@7`H`Y|S*~_J5kH*|(<r zi+rWMKie{Bv3=>y*0#3(+qaDDW==Tz&#?W&<a%k5?MtR~d@9=cBw{<`yz=!w%#E|R zelX{mQTl#X_50YzSwX@%+2^v)JCr|sllX4O!A;L4l6QZ(SXlkM?9qG8bp}pZk8g?G zGIB87DD*4v|E=J)Z|u}EYtQuGvQn6F=Em&Z_fyq6|J$>v#T+_tcb}fX$Lrgs#fb|q zoZB6HyCB)>+`fjH4SxBb)lQ1ZirwHjwc+SbDaA!%m6bo9Ye$3~aQY{kvmkx#28QOj zd(Zw}Z29ljwM(y)rl0Z7ulBNty5<$dmU?9B{7)T84YQx>&)>8;PUh^#>)XPV96#$l z&Q{x6cliFV1E0is|G!zN?cV<5+L?{o8q3%Ioga8sb3#y=@)y0wzBc!-J?B$;k~Syu z#Ifx+tUauJa^GxiD)08bVK3oU(($G0&}TQ^eZQ3!<sUYVz9C}N!f<?|=AM3!=JW)? ztDY5g+8;t?ZudNjx8hW8_usjZx$>k=g9YF5{h#J!i!WR8w_)$6DJhE<^Pik3_cpb9 z-`dATHx0!u{g`Iap&I5HQ)wTa`?=~+RE@4hV)hdY!_J78wMQ;>BprF=ReaczTiIPI zdGdSS#f~x43|xIroX}ox{BODQvCxMnd*4<`n(m!i!T$Ll*FHV>2@mS6j+p-W_Ow8R zY5m%xVSGE<+!VHzDr_@4!t2lUF^wm{M(=v_bH0{iPd|s7MDPC6F1os2p{Myud8hmn zq2Jb@Hcj@vwd8$qr*5dX(zQPoC(le+dSFtx-n+^YyE9FDULQCa{b+y045i#hsju$r z*4w$HlXvgts~@hauNPhBX4!U8CGz=~8QWKR%k0?k`t<Cs==kcVRp)nqwdJnA|HI|p zBi5RInt}6jdHc7U-oG&6?vJn67)9<)?(N?)bGb#~vxh?0lwNOpA1M~CxBH>j=isxN zo5Use3C?cmsBw<Y^F40xX;Mexk(j9Hn<lF}cC<MC?2_hxy!_X!)$+&X&NVJ#X3lS3 z#n8I<bj4YbXCC5Lxp)3<w)uIlEPX<b$OCWRw`WiNj#=^d%fuBnD;Dl;xpLulsMf~s zQFB*ly?JzGamA_2){}NN%@;o}x}@zMv+n&`*)6u^?;h;h5o6|Y@n^Y8c8I)0_B)Rg zZ^iv&?`+k}Pd_YOd#5?`YE1aUQiUbE-4^dXSlGJg*<b75m2Y!m-T(ahCzZQ9Z_fM= zyZN7}JTafS>+7tRn5kMak9FqBCvDtvyY%laO(iE~uda$Gs}rT#H1un0Yajhfezdwc zFEchTv-Z2fk1#p2*!~MH2HJC+lE3lud^{fT*<Y_->1fhg8;;&Bs<U=nzGKn#ygj0H z%ZB=Swo+T4uDPq1|Hh?hgYoRB<YF)7h>*E^-d(?u_uK5;qo1;04890mxe#|~I`7-F z(>eB67?=FonwXS!)4lW2?R?p~k7*g<9H)<#?=2ASNJ`u@&G>JP+j|d-K-qbDYfe7+ zf4S1VNv<tU>3~$#q}6@39u1}@EBiPft(>}t@8*v`hkisY+8bQIUF!I32|KyOkN2*X zAJn_($ZWc0`iK2(&%T~)4d1ZIF>399`|7|*eVtwYDc%RRMt^*<T;r<u>!c&BMy75e z8B0q|(py=LBn$VgYqR}#{lXmqzyB=9>QeHP?SJ3e@J?Zi{Y0@_<@<a8XSzQxm0(|T z{^6oef9qw8Z=Tu96)I_!w{6XYkMe)kFZ`*btI3dlZ_zE5E6<sBUh*%jFgW?pxPC=K z+AP);TkN08|44Mc{U}E<OySXY-nAl4%NEw|)!)(Y9<gVep8k#agUoMEUr^yNxav6H zb1zG+n(DCww!Ck*T3g)+Wl#V2;PuN{?2BJ*ct7*!cR4QQSh4qSJZ%e;dH>y6<`-z0 zoxT3;pSQZ+ye;3WWUodCYSe{Gi`Z@De1By2mLDJWC;qX`{H)Az-^SPBzCw~yB*WXN z*=rMyo~;k*+_A&^#_7zhZ|^P7YukT+_P6@|PZ#h0_hs^}`d@DEE(E-o|G)UK@m98v zSNhru|Ibo4Hn*w&^7PaFnu_Pqrc-xkyZ<hDv9|5sOS@uceox-Bya$)KohVx%E)aF| zMsuF<mWOM6zrK_(Qd-h6S8L@2p@-3xpKI3??*95CW4?Rz%;hfwa?iaAuKv7l_5M9C zu6&zbG2fZ(@cVl&_kN$35hu!X$D;rHc}X7K%uIXRE%smT>-SHbwO#7gt}TZ?-3{)& zcld#fm`e9u&bdDdZ*GdYy=TwwR`Z*Nj_SAEziVtiH!I!X46~eZ&X%fkyVRpfT6|+W zD!C7Sd7t)hhDlYH-PMbQt8aX~rRs9j%g*v;#-~eBKR7>Mv_77GXLHS-jWyX`$L~}M z`aZLX=-VZGVSD07r90Q!CvY3=Y20)9!aBF<$Dfv~u<6NL{@(xouB>qMAD31i+c(et zpN|gx^k1$v<=vG2ck>Lh&y>{MejRa&CtLF8Zv&zIdwc$Q#q8+2ebwMg(ovl+-yW`$ zcwj0KT@m`|aFAN6U0-AQ*|mEz1n*UGYd0+3SboRM<j>D7FE7V>9@);;EwiP?LSlwC z&)Q>8xu$j3+&p5F_?gAqEAhL<jQXlmZ)Uvmvbxg$O-ML5Bfg)fSA2PD?Tdx&fBuTz z;lBTT&*2?8PMtmrS|;DxaBpvfU3F2N!RO1GpZGTmYb@MvvgQA5_IW9sf0r&4?cZ<m zMJ3-ye}T!>hx6C+#INMz_q+D}{Y0r_EM69co4M;WOa68LFL^J*Z@Ojrg0^o$bvG}} zZU1;uDQB*JWXqGCH+p{FJah3Q*S-HtUf(xuJo1PqC-!*Q4v%9Rmm?Y8G9~Q4I%P@4 zo(c)=*-IyS>Mq%QFZSo7>AZ7m#BRr>pPjg3`n+9tt0b~#IG>(hC30+Oj?Tsz&XKl7 zd<h3OHK_8onYp|ud^V}~@ASt01Q9p2qf_;#ZH|ipnQ(Th7vJdvU8yYrH}s{ZHM;R$ zm~vj`5|h~Hg50jk9G@<|Xc1-m*GH%7*WJ9})gpDvJHWY`Gb=;i@S>pD`Zw>EN~om^ z&9E!)VPCqEZ~xy@tG2X#i=JarqOeZ*<9|k}=h8fEb8edcm%lCgO|A6HxBrQK6F;1v zWSm^EPtQ5PL0KoR8ET}z*%pgk7r!ySy0&OxY*g6Q5Aqx{&$bz-$uXKenwIwGZJJre zrO!;)LLPkOpD2F*Sn!QSt1G_DZ&P#iS{vM-a`DOExDYw#yWSErID6Ta8J|0RVy)CE z_h=nv!()HL&d+gKqJMCf{Ndy>6<hs_fl_;Jv^~<!IT|Y7K7UH`<Nuo;_AF0d<kfql zW<}XX$H}34XZ#E`Gqs(b{8)2m<e9>V_E60n$2n|2{%UGE+CAF5-_1kv*XfP6?4FzF zv`_Re+OG3?lXQom|Hpal{0AlaX7*dmlzy*fbMrz{y_sV~+f)JN%DQCheTo)3rb&-A z4^8Nb@cbM1;>@8PUK!klveVbi`<pEIx%I#y4ev79ASE{*W%rn8spbO8N>yr>(Txx6 z{`kAU?mEtwta$YP+4T`0_P2#;T)7bEBwMgLkV)kI%{jbjO9aLK|GD#2#Pw$4$MmMc z)$&O(&}eexeXF`+;a(PKq61YYk9qg5ejAlpC6ZDc6Oz-@9KG7~N_pY+291YTqI7@E z-?O+-x9IiGBc;*LrFOsK%U$_C^2QX&`^O5K@BX^LA}haO)#CLAnoa!{!COm(zu9i_ zoc;T8{Id2l<x*;=q6C7I&e^@)ZT&Om+FI}R>+`KI)Yk4bD|(Prd~s&$@6V5H|FS*# z*k)I=XR(Pbvy<>_wu_N-&lRp;6%v2<?onCmVom3Wrw8Ugl6IZCV*jn=o>`_>V&~oq z{XfZTtD(`py~`gzQ`)%TVL3yMh7UJq^M$562d>+5tetaq-Q}_#fn$fhdcU8dR<4tm zG&8SuWAFYOGS{b_FPvZU`s>cf-S5q-cFEe@yAb<SQf#}Li07e#wv2gpZrd)kn9iv@ z>h)*({)vlc<$vF{w(n%q-Pz?CT=!2kKj$mX*|PLbrG&BIM$Oe;vvp<`Jv%rhy7j7I zpdn}8s&^ef7Wai6e`Z#=Gr3)uL)85I=juNj7m9M4ZkZmyey9DeLrZ?j*86#4rjk>_ zmBl%4b)61e_9@^=?<+3H=t9ebw?7BG+8Um+^qA|1Qzi>T=A8I)@YP%U%&O-{!}*W9 z?$G*pdwbZ_TI-eSMx}KtCU0)OuGi{z)XLIu;gT!P@;xQj<Ui!T7A%;O`Ehb?-oh`R zFYWZU@14K?^-c?IwQb?g(t7LPMkM`g7cDpWTl@8)?eAIJ@(;K_T&W$p%6YHt$BV_k zdQBhRDqdT<V?s>Wg1Pk{UpeH2teCKG)$;A>eG&<8r}kaia9v6M{!X1=CI0UxSzi28 zd|7SfyzY<1&pvNFqVebEhMAvt^PI1nHD{N@QY-B_qSX`D9@~6+i`<`{{F6x!a+16L zxuwQj|2RYU_M-mCS1W|m?p5#l$`QU{dS-HL$+>mR=bs)qcirwpw?|IQn_1JI&5&58 z{v>bS!GCsd@7z{SJM&grPRwSRZ)-xYl1>cIg^Tesml*zCSX`lLV3J~{*W$bR%(MJ0 z-bqf&;$#Kx7#}*EvUI|vUAjh>^tilVeb!v0%KSO<+1z;o;Y&;1t9v@89KCR%cW3z> zxzgkF?f+S?-nz6eN#Xo<IYYB=Msp{`-&e8FvC>ymK3x^|jIa0X+H@{WW!4j-Y^x@n z*?44e!b6YXIW0-EzkaMTJn&)bIpt7K!-XCUNvq;Idpit{mrj~;^kUlY%QY#BLt10y zYRo64Up&Hg(5S`LcjGjxt_qN^KisrlWTka-j}zanLkA?-RhXE5y>ryyos_wB;g$FA z)(P)Pe$2IcQ^zO0rz{fpo&4Xg**vF4udX`QR=2n=x-kDy(EY=kdSdRS_}QvAmlu6h zJGDB{;lU&y>)hJy@j~yPJo23qzPO>`o*?H^N29lqZ>%nK)hK^A_gH4zy;v|pD8pa) ziqTug*Sq>EvaQQ^B{zjH+pBdU&PDV~lI$KMUk%YonNFD#e0KYk^F9-M@N6P;Nmydy z#9D@_Vsmn|=N!x{x%)EZa``^xkgFX|;pHZZZjC8bI()Ah)+^}7{mM+Aeq@K#_Lm0L z60hqTA7!pMn|Mv((C>f>wy%pC?j7?f+h8ESz_>@Ud%oN;r8wJ`tHu}8{JPr3Uu^T! znb-Zn<4TJ2b(WfjY~z_vdA$=3v3e{!{%G}4j@kTi66f<o>(Wp69hx;|tJW6oZNa<v z6P$%j4n6Nx?EcfLoH8rnZOeaqp09H+v@Kl9Wt^Vmy;w)HG4<q|6Q^zUFFX>knxEs{ zr(<AfrgAx1P%8U#WlQ!Z`)!`T&nYU#f7o($S<L2}O9ij5^I)|2yvS8k^PJtfqjLi@ zczt#-oHSWz;<1c#so)-?vp<*5eRgv3g^eoLIpb!wRqpZibUSt<Wzqw&43?cf-4!K4 z6Cdl?%$oi@(_@(}H|Lh`iZj)wuz?Kt<GoBay!FQhgS^ITJ1gYppZwwxFFoapsMC>+ zZgQ(0AITFvYO-VLuY1!nvwu%qS7aV^d)FVC2TN}%JUD1nIZ;^M@5AveTTIrU+7dK< z+7I!^f*JhcN7+A2{j~nymm`+t0v|<J{4(nDJDihH)a3K**y7pOMDt?mekNU6{ObOm z>g%Vf4;|yPi<_c!`Qv_u>qliC@tAqbf9&P5iBQ@x&1+NMOn%vKa_5dLGL-r{=j@sc zxyzz0M-Nm;M6@m8c(#8V-`AhtmQPYnEnfM(NqgHg_xZ}c4SMGfe=9RPZSv98#K(CD z-|?aeiRQ<x4m_CuUSHnMs&-b@)h@Q?#K*JGFV(F&HDTtoW3Nw`yxg(%+sWB>UYecr z@9kgoYt6%%Po36GUveNiE1zpFTT9I+euX!SpZnF6ec63pF89~F`da(+)TIvv6<be= z_-h)S{Tnms@wIM`?XzX0a)d7#$<Nx){;On#giuYZ=b1%I8-1ff{)pFYket0O@mGk= z+_OQ}+ql)&E1GgG^X8bZJa^LZs;9;$;<r5!UZC4o%r2m5Z7Q-t>Tfjv`RbgjUHP{4 zFP?syU8z_XvHiQ<v%d^$j?aFU`u5)3X=RcYcd`VMBbog>e|_ieUsJI&<(RL|ldt~2 zrN7&4P*P97xJovAji!&x(i0|5v9&KwKX-oqO10ghGjfZ`0`V_@-~B%?<M`o>#?-pA ze%syFpV@RQDwOM-j9b_7o7Rs$y{%=MJoWsQbv14!>kK8Xb?7xGZoj+nTG-utwexKZ zthY|EJY1H3j`^7+kM`4-K5R!%e0frEkAGjwy9|{Hic>#+`1v$^{hggf_d=}SKfiQo z-luEYnHx@R$<qA&?dbOn!l9EEJ^g*N^7qW<_g3QdZLBrhf9Fed9Vw7^S~RoXU4GK* zrK;+m4sh;wJy~Z`reL1A<c^3>)U9dLZhf)8KXI!;&V%&l?bpvp9{Z4<nc2Ug`16IJ z)899je^~XsR`J8f>Gd0Se=EKB@l#*>;%WB6YD*`ialV;mek@^X=0P2S#opU8US)?$ zgehOSq~>`jYc<E0uZm6)FVAv+`TF|I+4870jh{DujC9F(vzddBr>)lDyVA7{_OnEb z^VXP1_^3^GTim!)KTuQS<<tJ!=l|B%tLMBD5&QF5nt6tlS?gD4oyNOP8%}KrzOwM# zZDplHozZd@5v;c~gO_jWJI-NbrF!O)_DrLzi>BVyxbR_<k9JvRXZ*uk=0%0iIzP3= z?y>FbaEOjdGCcV3b<+-(=R1DfY5g#7-Q4T9E^NwOlmAPu(bVuPw^~k3N4wV3lCGuY zw<i3$th{JX=lXj`UNXtQ-=YZ0(x5WI(a2V5i%ppkOKiPWz&@25f(wp*6ZM;Yx;Xd6 z>r%ZXA2`aDyTqQS&RkZi*RuR!YR|9BEteF)Wx|&CFV-Aua_TXvcAu)D>me=c-GA=f zBcBbo`V?oDNnQ;rm}*fV@YmikarTxY7b2b<+2j46v1RSi1O9?*oqv=SJiV}TL3zYi z2_s%L2jiYOY$926BZ?X)E<L$*<JI12sy)1w%6d&xPGz1;J#ixExW%#7L%GL6h5G3j zHH}_bp9O2Pd5@aDO8cz0=;gFJg`nPhnP=Aj3=`Y2=%|!Ww%-K)IV&GMy|ydu;<-uO z^7FDcoziGg?cv?OK`m)Jhmpz^HSvpOJ;^bGPa&?|87ula%9;JMp22!+k^ab|VWC>_ zUp3fXoZ9Yx!Sm4^VgKdb3P)w0GR`>`y6de3q<#_hYEGFIAQczC+ts<V<+;E!kILG& zVw_(r7XEB_?2w`Hs``icw9M=x%d%IVJuD};)ISW#@|<#<6%_I@Q!}FqUYVX?Iis@i z)R!6D0vS`=uYZ`uDWRIU`CRL@c>-JqcAaarlMwc5y0%k*s|92cqxR+Le98Y7uh4S7 zc+T*b-`voMh?LmB2PIq%=LbZ0XYfi%x%JqUt$!mGVjLLU*d!#j={Lic*MVDkU8{4R z{fjP&nXdcu!}4F2H@T*NTvEJ4e09>?sby<i4cD!iWmx*?P)yo1%?X?lGw1C;y(i`I z?G^8iT)J;OIc%cQ;)wn6`nvZGS~n!DDtXPt7b?MKwPD@OS+h=+nR?~RA3CEuIih!+ z)3eMqiIGQcs9pWVHO*G5^@^FNYt^H|Fcr(BzW;ZcW7RKySJ1o0Id9JfzKu?=!h4nH z3g#OtTdxUzcvMckS0Uas`Lf6}R`yWun^El(1Xd;_akD(zcZ*T`@}5(I_W4)$HXaI@ zV{9}ztY~q>)Mrnn-5eWqv@O_nUo<|VSKvNBRPki^;x$*5tc2Fuo?*Ct&p2a-?owf+ z-c&{ZuJr8+9oef}lw_wl>9L0GKPdC)Jmcaij{{WR)k_*O|M+4rsHB%~`1)MolF#KK zbKNgG-MpAn+{_>Lx$U#tg!QvBS5DGRGt}=A6n~$wIWRmwx3OeWroQs^h(|*FzPoyt z-_eafc<^=9$#t!gKeML%(!0XlSMt$wZqj<Gr=B<0+z!6oa^>Wmq(06+ficq-8Bf1( zM^eJw%G}#Y$3Cg0R9hl*qW8ky<u!pkDY^nPST^|xw-`h6rLP9>)-9c@)}MA1nCx!y zV$rsL3O4*_H+*Kg^8JItmW-q76MU)#qP9E|hA4mQC{um@l-br7VDat;T~0ZIsX`h3 zN^6Q0w?0htn6kH7<7AdlhLd3jzw@hV0Z8ign()$Ps@C2`%T_N@c-(vM(UqHvTS8WD zkx8FY$+OP-PIgtvzO=Vd!THX`C9>i3->ck8_`YtPwYMzq;u9C1ukbs&)*;%{DK)?F zSI$4q9cx!T+q$Sp-Rf5f_r1H-iFq4M!lO?a?p?g!z%%*Pwf1cO!kF7fF0Cxz^+5Fn zXT{8YMJd0zYh$$P7j~DjUkc5bY^Ogb=XK1Uiaf816ldSE9qTmN<V!YhmD^tWy12^t zRnVc|O5EqCm_E5$e8+0R!iA0gtJbJ)-E8%D+o5d|JgZrvb<?YVA3A(xv+0i1DvA26 zyu@ghb4$bPZ^cc~DY<*;_d2<%%&%t-nfYBeDG2@kb*@`TV#oPKi|2b^TCgWzd+5?b z4(=;<ZrL4@Skw3Nz?)MASBf9%b~ifjs4IFs^TyHMi}9=F<E{LppImah>sXUo9QEh7 zd$*41TYa;w?XNd2+x~X%o)^<{C+;%KerO(Yb<fH9U5WY;LAA`qmEElk(_hY5^XZ}4 z-mFN*1#hS88AtEFxIyQq<A$YLoV(NtEvh=^@;<L$7rL?{_HMS(zMa(_-_1|%_ej~& z+4ytGt80Hv?5sAe+Pd7}?>VJh33;`4`>jiJPVTq6r<YQ=QB}R@*_ox$Qr$PXqz|9_ zn`3xGxjXsMrP;gsLsoC<zOhMgfslq*pU$J$c%8~t-4I8M4XfgIeGgH+*x_;Y>&q&w zwkwZ)mb<OiGAKH9amiY%e35JHN9wj#q~G{6_rZLR*dX8b9TU3Q-}R(qs~N>de}B1p z&YlmgistV`uDuUgdv(@pZ=<)_Nta7ymT&&^q-CpgRo~_4T8quio!--bKG#Zom^*oM zqTswkzt$b9lJ@sLQKZ;?qsQsoo&*=+*^2*brc6k+Wo=(y;k(JdTITqtj?-6<_u9+G zEzoseoO;kZV~y&JrOP@_i~FlT@eZ9NZg+CwKE__5lvxT-Cin<@Ir}o}wH%u8#iUnF zsIgDua86E)-T7nNQ;WnO@3m~+_Q>m~RlBF5?xSDE?unx6E+Q7~Cy(}iof=-Ku_frS z>&*8ZU2CRjv*aFq%JP1@&C<BKpsNS9FSi82o4lZmm8gHY`TDN?`*vmI9W&SJE{^p{ z`q8{?-ia@_azmd^b@gM8*<~jq{qWM+$6i79y1zeqq}TT4NB0YC%wD6NXq;`iF89Z& ziAQ49cY6ghUcPrO@$)UNowrXtIR5<i;mht*Ha~oK{a$>)i(8?Es+#*nGv;rXQ%t%X zvFzNlzJFfNq$ghuJ$2>W)cyZ{>Q66xIj!-=3xU<v)7JKTg{<WJ8q+i1_<qVC{tf;f z-tAT1a+MDczpwxJC;$Des80{hggw5Qdh5r%%cb>IyTv&rYi1lQ{<TP$+w9KAcH#0o z9nU_SyO(#T_?7J6s8$2-9ZRtqYQD?zg!Hq&{{6gv-i{BfhNo^V<g?S9x-IF!n`0t> zdr$3H_t-Fco2xwc^?BKA54S!sifwXN+sv)KW{D2hmWS!BQQgYcNwP=t)92;c9&*hQ zbvUubpH1;rbCz|nrmd=)n$*PiyspR3JYkNy%j6bv^yr3{&+Ff>6Rg#fs=K-`z2163 z>~4XGS@Q(K7ax7&^47lfj3{%<x%iFtc2)KPS2s@lKU2u~cTVg#^#jsvMRE12>S6i0 zGql=lzE?e7d8&%{)6ewcdq$dFsw=sd*B9>D)H(fsYUi(9-Uq6hp2@$QpKo|R%X6Bm zWPJ9%8*0yVuWl?}ueFoqcwMycqm$Q^V~)5jGv(Zssug<t=Df%DCk`!p{PIs^>5=Kl z?ao)740g^AEIGR+FRfz9ip+{<Dz;N%zde0^>EEZT_m6ek&Hwnny{)c(kErMBiuCW@ z+4o<({r{T#=KA@+wIlpLR{i<)tS<T4v-dBg_tlg}KYe^aP;=#!Grd=jo1OoWe|YEi zHGyIro*&aE7hij8yG{Gu_t{=Q^IjMFZ=a}Zy?&<I=cCU)C9X^kGE|Rh4y@etl|y{v z`xPH&9WMF1YumolHBNI)ZVS1+OH*7QzhBR;Z1N5NxT6a)Z!gG<xI1-~n_)C}tcJw? z%9RFzJ(B`%98+JXng3Y-;=es_B(_e7-M(+3mpQvey0!<mj^|Z-!we_4E~#l6NkLza zp1CP<K7Go<^uVOnrS7wmcAiz-e(3(IX*yl0Tg9$dcb9J2()m29zd%r3Uw#%xxUZd? zMO#RFmdqp`-mPoOx2eSiZw*_U_-?~(@%GRE7Jl0p5yba&quNs)<@XPkTr;w{Rn?;X z<4tQ+xQ4C&)j&_feOfFFU0x^)LOQFCM!ujC1*c4w^*-9A@AfEZo9c<|kP|#L^|~Q= z@M-rBCDVq2jaH{tTX=YKZ`jv<RAS0{?#FU5``5*--cfF()F`%5a;>cGit;V9zLzdv zzIk%DQRiIog0Hd{1FzU9*4#UJ^z?}`F15!U_Y!huZd)Pw^QeIB-HOURle^6eSIuMI z<<@xUhSA#+XIsRego9$met%)FR#1CP1>6$;CgQi>E!t*f@>@%fWwx!sD?^_=Si0ZQ z=xw2nlTY-HYW7K){mJIfoGNA|OwYV_Ftley;CeTO6{)lKuGjSBSg~18V2{yS4c=VG zN>eHOgW8w9_WoJ2sySjAXR8w|06;|@xT&dfS#R;BCgVPR2k^*7TBXEtd4ctch3w~E zI9kux#XRZd#ue8VX4tReQ%sc9lRbFw`i5frEVG3P_LI*Yk&&2v@kZkvl?P^Xtebx1 zY?<TgCetl#)+{T0{osv;E-{h&=j-Hb+Pf+weo8OsR{gQJHX~uSzj6qF;WfGWInNVS z?7OaYd-S_5^5XK@!FKXX#0RFkx7oik?7Dw!d0|CNzx#jI#Oy*dPBnwZXRZZvxpp>v z>%HH;I(%c5no-MqX8DcE`WI>>;^Mkl{V$gnEa87x8&NKBRP9ZkbFBF}y@r=uZ59&z zi$7aU`rqzqSs?Ih`I^Spv0I;tKAGUt@9M7KcF%pwO}%MsKYkdytiGuH@7kurJl-!{ zTwEXC47;r|EsDv=?zOuQi$LSqgf?rX#)pbLybm5!-3e!ZD_$^dzs5wJCqIRE#LCSm z-~@%z8JA|kwYCvq9TPIoxYxBz)O?^7*m3xx(e%G}E^%BGaQ9g8BtLPoSabCfJGS*x z_2-Ek-gvl6wqsti?`?xx&ZxY^#3OpWss<0GR4yk6-fyisc+k|_uJGqI<rLdkLx%8- zUhTGrvu*^M{9Yu^BwlRBI6>hK^Gmb!{nJXCsuxr<P4MyOt1A6$52|3`=^PTxQJE}1 zn;2NO`e+xu6%#yTq?;$d*kEH=NUECGhf^jxNpGk2IBe73;~H?<WRDX2mj7F(bC%8g z#+35=(CG<2)m)ouA8LCnvt_-x?}I2LfkKCGKvq4}H(G1+TK&}Ozy%NVjoyB_o$C;7 zuUM_O?@)Y7)RB*qv>$w$Y%8w+SbC;h?X%|cX9*R;J55XZQw<+RyBe;|&1B3!y~RYd zuVm_O!Q<-3Rd4>;YQRyk%IDtGBb~zhwqFGH=v+QE`}WKD54Pshm(T8EdVBFvh5W|y z=drfFOm8cje#%bS@BQ=D@9Wk|4^5{mU!n{0v9qSpS+ljP9RnHH6?M#Vv1-2iVwbR{ zpm1mQt0S#DJ!S>mNl0>!x|P?gsGHk-FyM9P7g5E_&-oTC6_?x`_``y4j!T`E{_Gbr zPLtZ^`i6K`U+whx?HQkL{X}fJlC7Zr+eu|ppY2{Ky)}a&Dr-VyLsy!}f9Xr*i`L4l zlF7WiJGtuR6|ab7#~mv-ZM~5>p=e`{LhbA5GZ%AQ!kC0EC*~Z#nKs*Y6?1>%mMv#0 z`Eyp>{d<GoY{}lbN;&;m=2iFqoWFM8?3!HdzmuZ=cJ))<-<WZ)y7*}F?fqN7Kb`vh zp01lQ`@fHx4_Y6;XPkcd(j~cTZ)?-e?)_9!SMp%$g(++Ob@x{vdK%o~^L@_ozdxJ2 z&$8?))}Q3vGT)mqad%PNgI|^$LV5T6tGK-6Ts{hjO?h;A|AyG5-uq9R)vYsLRKd7z zZ}UI97WYkOrM}<E+kB|zRnp6lv|iI|E2ru(tbcspQ2gYk#xI-fjoSTMb^16>Zg*JS zP3wQ<u=x9rZt1c&e@{(MI=6q<SLv;7=^rX@wS`BQwfwof-}dUPvhyo5`?u`d^I$Hc z&Bq(s?z3n8d;Qze{GF)}Yf9s6IR-QR{l7otU0YtSsr&YmFTc&6=NS*b{M#ZglOOr{ z<)!?Pd*<0esv#{t%Tto#rM)iC6yyx$-4Rr9|H#b5mE4Kn882>{U*gWYZGF=|&bw8P zcYgjqoTHsFFEv#nW747jU!BWj%*?0$nW8$a!^$O0?K9h@9g{8dgl$`USIm7MC~MGi zJl#(0Z>z9=eR+b`G=qN4M{$RZ^A7d?TWGy#*_|KVH$pbfiq7}_|Lk+{8NuZ<ng2U~ zia7Fr{??BCPxVL6T*_E*^S9`|#mR0KYMn|cR!XAfZ=13tC+L0^s0j2noWJ$=hSZz> zR+?-l^%vdQG<l1|i<peVGn9Q)-!#?nE=|0o_dm$$>?O_0HHXZ^9A@|KsycamQ)9{J z!e=Wo1Z!GPr*3yIU9hlom#S`We%7_n2iE+1{JRetJhcrwsCg(>S5Er-y@T^(w`93L zbrQ>dc*@H=;c&69bloxgi+MuAPyBNqY&9*|an)dHc}TbAx`iAwpPkfC{U391(|nWr z=k4wum${^NLCW*Qn|F=tf~5U_`|npia!SJ_UtuoGx*IavPkswYFfzUMN%q1o#}Dt$ zw3Z#O4wvH5e)>_T(Rlu<vrqo7xp`K8lh(}iwXs%{oi&YY8Fw*lvi9!r3^?_LU0rZy zR`QOwzYLUQW<5INnDblt_Y23K1JC6p?Rl=d`EUJo=f{%rS8Ff!DbByW@vFAA_H*A- zo5yucLCeyY-})o-?$~ecIVZkMvXMF?KUdRuOWCLBX_L3#KFN{#eh#nbJ;4l?l|JR+ z4=)GkShia!?BtnW_TX(?hVjMQhu5%l=C_!h-!viIXNIue&-h%&pY1yqbFSu3_Um|Z za}Q_nc4upKi>37sKCOO#Z{w%VGh3c#$JZ4dPOj<yDe~doQ*-U;|J&-`{jQ(&GvnOZ z{FJ<k^)IY9|2uT_UcmnU@AL1^w0vB@JMGW?>*i~J+*^3;c-Zr;a`%3JS#KxCy#C_7 zSJQ%6m-=+ipZZICq2a<}iO#5&GpTladc4H$Z(3N*#p<u@*1T!!nfcGZx`lkopZ+sQ zD(S%*c_&d#V-fM377nH@8kzU*`kxby`Sbtu{@T?aUqm0+)BgTUWb@zsH}?oUkAJ%} zIqS<^clqd2kssIo{jZk1zpGlT`g+a#AH~xSWN(?7rx{#uYKyM3vxQ!b?z`8{OFqO( z{=K%@dimo0><^1?gnxLIJmceikDJN7YvMcm<mTLJbY$6?`c$!7`PDpjvp=WJ_kRg| zIX|hP`$x<Vt+U-#m-$!mZ;$zZ^_%^ka@il>{n_MBo{af8dwTf^rrqrero3!n+U)&D zXnNBj7qgU#zq_uqKDgDg_{BfN$>A6Ovb;Z)kbCST)9iK1EAJ`xFHp#dyXN$5;<`!Y z>(`imIPTTlIQ`+>_&tUneol$f)j$2+WB&4=_T1X+KFc=rPUUCx*EOHvqxSLjy>~X= z3Eu^#7`^pau^?G_j-P!{wCIMYWnH?BrY4yu+0<qSFKe?DzG%>U?9sJ|JIXBc3?Nk% zU(lsXm!|B}Ik4Nv_qCv{{{_7}O$Cdqs%;l3`L6gOu4lf!LRVzjs-wSe-mc|;A7RGn zx1%u6XyJzJhnxS}zS+djF=emN?c&hM+h?2Ko^Vfa?t&$`ziV3gZ%;_MCFed_TTGti zmhdt46XrpmJ*6l4+%~>cx8$C_XTzgnXETTckm^cDqul=B$=WIHM@!wzQ<#6fdssW? z*8K(VFRy!CeA!0jvfqa6Dxnvg3F=3<<lT9WaI!T<q}4mz%bS<y9Dlo5k)u4hQe=Xy zxRd6LYU`BqtpNgdGwpo^=CvVOjwqJBwGQcgu*=Qnc4RMW>xG_*IH$ZRflFD{H@82k zF?k>*RQ{kR?x1zpB%j?ri@1(0&8had_$_g>;Que{Qj|8P33IVHcXnDDm@WQkvT6DQ zQROgIj*VM<%JgM7Zd`uCz^kmMXtF||^ylR|ZK8`?cw5WYIy=hR{o9%nRCw^`#U3Ly zoykv?a?VzLkePHY`f**pycEmhs)beRmdlPuc}t&|;Iq5U&V9rGPmJq$m3IakRa%4_ zO#Ja;ze0}gIkkf<Y8S+mV^@`gbcQ9jO^oPm%M7dT5{uqmv!PUL&5MHq?2i-6P9;Sc za-9fUn8y*Ab>@!x%#bxwS2dEq-~M58PR3zF!E|Z%tHRfI?7lr?>E+Gb3A-Mtxc?2d zxYYi^ZjE)vubBBJo1+zGmi3-LBD?bNg}bNw3})Lr`OPL@-<Dxob)>*M)tx&lQ@q@| zx@%ej`}N2BtTOgDY|dJpc=U;i%&Ws^LYubgb$cG=UM!VrB7Ra$JTk`aEvS8HasK1C zx+5RVqgl-Scg+05G%54CfUbhmg*9g{t4wZJY_bfv7_cZs&+yK(h#M)rrSBS?7rkwo z*lWHasUuSM#unbo(<6Ab+av^~8qMDw-l!cmxocNouhA#VQ)|ugE+xH}Y~OLnc0*G8 zWEtJq1q%<%JLF*W)@WK?LD<HtPZZBQ6Fs^(gYn|C6E|5l-w1Ab`$k-P`^^nX{;Ot8 zoa=d1u*azAtQq5%r0o_*&GMQA%<o3_am}3IjHOEe8;&<wXmY|$aG?SVqq4MXOVEdt zaU2^uObx}jj1``+)?_a3`1VptIR5R1^*k?RFUoH`vGMX>k<N>XGruX%S(WZS+w;ha z2|m9C?Y6&L%mZpG!keW%x|bKve!k$|Jn4nY%D9tHZ#jRqn1x??=7pup<iyu~vz-(5 z?xW8{j@4{}vRAG=cAAtaemo&_#kK4cx)*<MQ)z5Ed&A<awvtH0)p^{UCJP1De2ei| zz<Jc+TMUOQwjNH)C60)hY1R(c7c61O|Dsg-ZG~d)+BqMVtiHgvCbs(?o6GfucK1Ek zfM#(!r*Nn**LkwSU^`Q;>WVk6zjDHstdbHDU9gy+``*@BksF`fxY)14yX)%(xg;|a zwP}8{H|MWUmZ~qjXw{>{rp*+*?7XbQ>(C|c3nSEH+m4igmV-B+VG1!>Y;ihknaiDv z@p&tk?B%)9`KxNdJlFN-r_VKY6zzLslu@>bagt*9*60a)C3l-`(us(BcHpdl*&@AT zjgw#4bzQD~Bc~zKWpW`gIKlAvlerJH7V0u=TIikf+nGQ9Q2ycLGy9C4mL)#7dXt@S z)OuO@C61!k2B)3p%$SjRIXSX%!nB>Nv%KzBU)<xCaO%s?&mL!|-&w@S8F=fK)y4bm zA3Q{g!;Do0)@+Q>oodr_dG^MX<y+M2PP>LIk6ycO${)^NU61bLXJkb56PC}oXVv~{ zzh~r$$&c6;oIdz3ZOgX@XP-}4ExmBZ^(8Xb-!W?iUTmDS{NrKqf;Y@2=iF`0_m#Lk zy8U&<8s~G2B6?+)IK*BX?2k#+t>1VuOE&H1{Uy>r9$XIMX3=TXy!?Msr@X9lC0p_K z?zpB5eeJ^zlPxFQ^x<U5))DhobuUx!K5wJTfAjMr`Gc>#PO%+POTMlp@@C3Y@uag( z^QLI|OeiuacCn2PC>Lri%=mplM$@M#qNwJj$+q>*m9}0#Sb`?b<j8p}FZ$T;xaPFF z*2``iBHC9@lFqe!m+*)6n%Ip?CS~zQ^*McJ_IVvGx+pd4n$E06oKw?UR#w=z9rfYd z*MBH&_0mZK{{pkMC5xhUo2M_}N<2C3+|e@zo~5~(hxgm*r6zKoQ7_%-TJ*j6&8PD# z+g>@QCAhk1pIEew%dNO?q2`UvEhkMD-8_Fx)kFA~&|@$6)8A_>W-GVsJI=f(`i;)o za&Y+kkI>cr@0qQ<=hMt5^0tTXFiqa&Vy9w|I!is4-S1n^Hsg7RCMRxdoOC;<*sJ75 zw3Fd~p5CpTl`j>p<sIHP_eP{vsv^J4?8M1_)7D-UeZA7@cg@bKIo3Tko7ePf%LaBl zb>}#iwCj`Xq0>^1d9ue=cFt7U*R<3xh{J&?Y}sDt9KF}lSElc_f4U>IQO~N58#K3s zl6yg2Eb!PtR;o|5B1c=s`PQ5@0$h%H=UaW+E2Od#{SQaoxHykHH{q#bMstb2^ZO3D z_MXiZl9Mw19gjuUu%6tqT;Z|Kz9ua7mhB0TY1%J#x4SFO{HD<7R&c_uTU=r0H=R#` zg_F|WCu|LLIs4XfMXqgcOoQsoWp3(BQac$|dpZkqIr}pCYVcIKt3Xy3pg5Rij}L#G zm5kZ{i@R2B`s!-!{=e<>_j9Z4^>m_&HeY@2uuE(IPUoqy+svXaU$}7Lc%k3f?N3&O z_$JrL?phXfcFoF_8X6i8Pba*x6Id4;AG~$#f(-uu#<5GYjNPXf@%V4+(VzG3d60>) z*YTB!;!cc4XSug%$j8^Kl!f1Bzu))s@Ui!AXV3fjsCCbevIg<X56>Moo-DsMbMFjs z(_F2Bzjr2{`0-}dw9T!Og|Ba){^T6+H77PP$mQ<$X|n$lEPftVvnz1jywM`N&r5XO zS-sa;w=VJI*jD77j#YnV6R{z4<+fK#W0S<@haEAO*eY|K_43nPUGY-Mjgp4jd6@Pn zbh)0YRamy`vWouN8Oh&nEuG#b*zFyywXNmAl+EAYE_-w(_GRbNv%il|JjcOXv?gkL z<d*+mt}bkq|9>m!@|+`I(vpAQn$=eodnqh5N%i_xy+Bp5IGdw|f1mwgdlUC6jVW%K z;@gh?3p>`!{X1(Nz3AVk7w@*!ckfA(di1Ne{k8Raan=9)`jYN0v(+3@{_NYgIy^qg zw%Fit7OQdpr@X+Tl!+6Vjz3+!$T~7%?yA@CXP=UaHZ$I=HY;a=k-6X0AJYG(_$`(C zH6_*XdxYQniThrCu)DgeIi~jAtd;GdtA08uS*103I4q96_vI05WZ?Qv%V##h=Jn@K zUfaih+U$C4!?OKP97Xuw#soyI@|5(qI`@$ES5AKXjw*++V801bdVx!u*45vi*2Vj4 zj!p4H#W}l50@Byz9}xavv{&R<;zFtCd}6j6zeGOxUhekj&B3ql?}bla`j_e4D%aU+ z<}-XJyE^q8=~%Ji>iKPT1u5={)8v}phe`hC7S`#nPs>PpmD}NSGeBx~O~v(9ySJHq z?N0C6^Xf>+!ISBRUn1*kd|X(RqRbwjO1!(Z{mY&dp0ciAQzF$?#BI;J$b4hds=WA# zQ@)56_x+uJE^1ftIinou8y_UO?*?wJ{k=-A_VSNQl8xq8Rr%6Y^=Ty&moCfNIG5q@ z%dWM%-mLz$%|877RuQ|+jdLemH&-<{yCZ_5V&=2mGivIm@Bfinnm<J?gYCTG;>?fQ zWf_Z~>)hS4w)WSgZr$x4?q197m6bemk5g~knWy!7cQ19+{=V&US=c#@+ctgn@{j4) z!?s*;KOexE=DQ=vW}D~i9p8QC7s^?)wzO=}nZ$LwV(ancH>{7G^}9HI`RZv~op*0r zwR&FoM(3LQ(<2k!JbmBjd+}LiB|n3DtIYCN9@8z;_DX(!yU_o?u?ov9mAmtvh@U>) z82Z@j`TJX|J|A1u`sZWkd^PbIZxi-}&it9sym8gm=cmnQ9i6q!aJTpw311hlkNZ^f z!(IuhYVRrW3cK&1{vdUh`#&aesp;p}El`X7x9`Nv+*uofC0j3@KNX|s6qGp0bmfjU zNqyR8$0r4yxNaP+sdZK8;oG&l<IXU>n3TFOf3mb)(Dsw}HA`dm?%A=>a~I1$|Cd@1 zW!|6h3<;g{PP*J`$IXZ%T!;ExuO+m8jcpCGDE5tvo%Kd$+97Ydg&VtOsxD-i`Hk<9 z>h<1~-33A>rJ61?{;;4->%%()Yws#eVFMFyTOBkQPxEPQxP1AOaLfFJoBM7FUvFKv zqu%Ly>xAUXUllffaDMWP?M_AGi>}|sa=Tu*G#t8O(&^;zz-@7C$x&w3<GqEQ3N36g zO?<l^F|x;QQfPlxCD0PDT(+V%mg~^;3A5BVnm%NE_zJT){xDs#jI&AMk5tfQ7Ds`) zvl3ZVAMPC7@WaMo_u5yT5;2+@x0rQu_uiT&_w-rOpS_#CCjYs7e^yU?&33oNwG+!v ze7BKrKKO2qLGGuQ`!0zrk6!qDM@aN?d8zUkr5CCF3OYT@ma(6g<>-#zzjo<%o8)aT z7HjKRNB(^~?YiH+>GP$s_?G(f{Em*TFPwBY?x^xl<8`HSbwz&{^X44Cv($90{>w|r z2e<9ro2wPSV1r~P=jlA5rda#(B?YD11bm{e7OgN)&iim_;`;ipQ=f!hE`N9D{O@&Z zGb%U!__tVk>sg1-lTPeAwt4E#!cRTtWG~xKjJ%+?<9e7$xOjT&Mv<)N%d)?{&3<6J z-L!1VQ#D@e&ndo-*M#)7mY-2&TGsq5D7Ln4{^lLGx}LQ?(%H6t<z}x`mOJOpD_>1Y z3Jq&`BiOQA!q@lz*5@`8_P+Xe^V5fwty5PvoxZZu+-9fCCqF*%7;pdY+wT@1+_^vX z^v}H7zHJG4{OWlN{~Vmi-1aWpu=uPb4}VR{i@ItLu50%%T@JUcm3Z}Udf2&eQ?od2 zGgE14t|*IjA?J_ZUDx%m|7q>f(qr)^8JByRTRETo4)-}#^7Ph~qwDz!6Pd67uUcrT zZMnOy^8T+0`%R>0M@Q{A<z@H(;o;X#PEkiv-rBOiDt@>p#H_XcckI-Yiqj7*>4+&_ zY4)JunWxzH%~rNMGdeBbeGrW8ShZ!<{?!8W{~h&QI*Dmbx!IF7VyFGrmh3&{e{ZoF zZ^!IgtJkydcq7;%E$Qofd`XJl(Rs_iZ{0d|+3dgT-uljoOw!qXYO0%R=j|7>zpXlC zKY9O`-Y5BKFE-aH7`glsEqnZ@^V{zC^Iv~Z(`NA&@#+0w5Up}+p@eDQXY+eLFV|hZ zvyRnxjgid}_PNgj{%vNzZXY3VFK12EE(JBW->tVR)(dRhcWd^cC9m$=F#q6CuC~&h z>ie)huV&$*qGgj~=1kYh+4UsAKh;t9xvZAx1dFw;t3&0?X8!ucekF@XS;y)?YQMsr z6D#g7Qx3YlqtTeXZpw<Nv?+TwWk=~3{i$9g>bvpt*Ffc;#?5x(;$iNy)8A~?=Xq(^ ze0SlZTA9+0Cj!l>oY#sgrsZYk{0OXiadh&dNWp*K61IE2xO3br^LqB-xHT4cL+2z} zO7BlPzN{(r=9{%5-sZW{3tR(pfB)kBqyPBXRISAyCME@kzII6c6|nu@#mV}|??2oV z^65~${@cl~r+(Wh5|$R}_4QD&wNByrb2qIo%S^A&e)m2p|5x*yrMDLbHM(_dj_O%` zYGL5!<h4@8We%t19Cu7KOs{HL_GEh5)7>|hMC7zx<(P8fEay*|>E~k#)7k~roHm>B zN2lKW)tPTKGYoaur5j(}d|Bm}w_{bz`Fqn>|Lptx@0s4tyZaX|JTGJGt~oXKp=_~W z$A)RIB8xw!PTQl?(igDuK+=*ZpGBt_b*fn&x;5oF%~L!1PfzybWCe~x@*GyCz5*<Q z5qOG}-dSsYut=92W#--$!SdSoa;>z$j*BOBVm~@G>IpNRcIWT544H7V(*AH#!pXg$ zV$ME!r(Q`W$Bo+AWxIVMmiRKhIuKs^F~g0q*7Z%mqz$Yk4>`9#o~Y<@diE^WTRMFW zyIZG(h`T<z@o`GL;I9k^4TkM2Gk2bodU}k5Lw5O+T^gd|_S_dtl|&kDU)ge(_rVr% z<?mmfOS^fN25Ob`c06c&hNT?jU76XWz_GvWiizNa8)xqnSUF{w8|N=cV0rj_!Ynl= zA@THEmVVXh9SzM_OayOOyvi0|zE{{~fkT$njg4<47xCy^<@{20k-2SyLzY!VVpq>~ z)+Ky@guYE!IQ3l%!^)QlEg~fe2MU+0;hZpw&q+nrSHPvgA#0YxAL&gG1-{@3Ox~55 zhwj!C2-&|nGEb?+&!W}r&x-0dA~7dl+)`bUEbwsFocWd=w)T$yh5qcSdDN=TQSO{I ztH6A7aNta<l_GX_{k6U~LQQV=wCy$w=6>9eo%Ks-+LMh3IF~Hs{NHrN#L%+u#e`bM zV^%)@1wK!Ah;D9k%$S{!b$oYK26scQ#csCsQ<Bn+H)(Ikw#=G;Y+nY?mB&p24!e2X z%^rWZKf2iZ;;rs4H-k>qTeh{%yb;!Z);sZnaz6jP9bH#6vaj6@-6oma7}(Bdd+mMm zMtM%Dl9CMx`BDwi7t*XfSKXG`_{^{6pS;+P$G$E4#|}6i5nr%OR6FToyYmS>M|b&m zR?RbK-Uw>fU1{+}#B0_?<CY1JJLI-bU@^?}@D-k{{JMR`556tME%H%QblB?Dt@n!j zeR_exa^?-rKYM1>`rOzc^_ws8gv^nEJ`ROtBBio7sw84tC;dMezwz<BuQ!yJ_WoV3 zXc|B5hso_8tw=Y{)D?Hy7bZTNz9RMbQOy_s&Ykc~O<pi*YSsqfJ?&+JNhT6;jhlis zBHEZD`PQ2=g{}}u5;b2K@xjI-O_4Kc(}Y=SYVCEZUUqKo{O>rA|8sgW_2G9(WtO+; zt8RYmK2-kY$HVIdpIF!AyS?rX`>$_%<h9Kd)8t~Ue?PcwA{zGm_&7D!qe4U`|LCMC z6DJpitrEYU^qlF-H|NXhD;|{1`K=vf)Myi;f8>{ljIQ%NyBHaVOG~&t1(F@JX3db< zW%h#Maw*S>zzF`0+GjZTUSN^6m@AT_Vt#+-+DnNqtmHIV!?XAT6qX)%np7dMj8Ug9 zMvV2_!5pD03r_Dz@Sl8W+EIQ!B@>Z5Z0epTmD|)JuU`<~wy;3rx-UnkTcz|V*ZUUP zmHWav?|2<FF7I&?I<iF3)OQE7?-7@zyZa<UxAzLh%64^}?0wlfYjMB6rm51Lsi!iP zChMy>_VBFCJXG$Yy3pX{^;QLr`t~a(jsh+5&RMe*I1a5>1eGKYufr2RyX>U5xwq2n z0u*L5IP!z?j7jMM2dh~Mrm|Z)%<Y4(9paat-nPMchn~z#Q8gA1Uv^WkS1VVZS#|c& zhtf_pM+fnF1?EeZbsjjjXo_xC<hlhXZ)h)M@bDF8>|9({*7bCa(5@RU8=SIcad^BD zS$8>Z^PR~eCW1TQ_G31V;Dy2#;WujemUC4S%q`28B($_I$aZ1jU$SiOgGawO#FxJl zns?wR=f!EK-LH3W#CZ7jH!ikPc>5;2r>N24*31AF$A!z5^0pc5Tq|^BZ`TvPL+b<1 zuo`u*UOwOOQEj4ugv~5&!?;VAE+tfd6<xP%>07In-mWYH)4nrTWGM&#+h@SB!!|YP zQ^$4CWayrKV(a%MT{X$Q=&8Z@P`a<$bnA-6cV{R(RQz#TC9d}9s!X<*8BUBlLW3vw z@#(nuuFU`ivfz&iv%VRxD}9`9?|eB^K}ItE@UiuZhpt}-7b1INdmi#{_{?gvk9VWg z`e)u6Q>5pAiJM(iy(R6`b9u?^`nrer&DQqJd-d9AXV3ajhQy~_A;k^45-VI5z9?jw zsHjoRymaL=12vVl#q0Pz1vhp0+1@=;V4jwhDDz>}EV*a@zbBuUTk~t%cOzAiGtZ}= zE;7?u_4lmT*(uV0ZF}4AM}0dxb<g|f^ZjQU9lf4f%oudJ&N<z9gUH{h9HzgIq(s`U z=Z|ytw?FicO}XG_?44`v4-H(}Ek5?l&7J&4P<E64fr$2(@=5=MGO`1TxGL3nOg8rT zy*t|6yW>_X|JMs*8`@h?OCXnfCI?Cczt?k{u8k1vwwG}#<FsmFKm2uaM~y)Ate-1p zOzvHES;J@JvpT>2A56a^6!#a*yS}rz<Gi!0aoBm+iPt=ZW3Agzil(Uk)YmHWll2!Q z$VXL85NysXF3ozDbTCJ!TIBYt4V9WaRZrd?ln$RL_4M6q_ns5+_iOULe*1npd;jKw zTgUCsS3ml&M}78wbKBn=?|u%OTJt{et$TXi*C(IbKYx?ERq=jJ<7syza~u9Aq5Jo| z*|qT7?ybu|G_0#~E_%QI|Kdj<dT!mf5x)F?ckk-1{FB-@e@$KDf6p#x$L_%JyIb6< zSF5g<elJ^pMDgkRJAd{sZ|Jb!cUSu7QV+3LSK4~@ZT2gB*Z$o9Q)FN0?McG--kL-f zSB6cssXYEg-|o`|oBMliPn`8l+G!c1e6qj<Z>R5`HCED^8##Ip%;8wEzBxR8bDsMb zpR#HDtNP}ZrTi5Tz28{Y_rbY)($N#OGU`qrzBaGuKib@M?@8#j_6c%AHSfU1tm3uh zu8S7vi7$6p?RryEM8~-?_m|+x2frrD@!7HOyF6DQtGMhR*Oa+MLZ>t1)aw|hEVSs} zIh$>QL|Xjx>(Y%{A<vA<3x&HHnJsm?UMyaHWJ`Hq5s##mVu@L`{=@F#fFC>4ZNGWs zHh>EF`j*oUJLX4z&(*sA_Wr)atsk=QwcXi~U0)@6<HMh4K5_f+&E5L*=>&fH)s~yT z#XY=~eDUA3UhcyN9}etYarEEZY%#y1P4&@Hg*$406o1)Q`^iXt$;L+;-3$%))P31* zdCRAJ&7S}2&6B5OKN9=+-7BW%%i3V}UoARyduE<z`h0ELo@+l&Mc2pGbbn51mFIu+ z|Ln6?yT49OS-0{%E-ZW}lC~-!tlfQj(hJ)+cYD~BU;i?^;-qigRBD#2ywEJ(V)?wH zFWP~h46UjP{4KtTE3M~=&u!W#zAB@I*;F>UMoUsE>G<Qd6>FueA78x9?>m3Nr(1>Z z*6X}uKQ1u0a~0noDGu(#+r*}%M=ajIL(E$I#&ItR#r3}{=I)mJW%A_MBYUqK+D)>W ze{v_cziN$`-?TXO#O?O$-<W4_C^y_Uv+0}ohJBLjZPNMf_A4%|oh0{2)cDk_jh3SI ze^}*o9OC|DgsR;+`&8L_`|JPPlK(Gcf9~`D@x@o_<@^7r{{8E4bhCYTwUzq5_iN*G zS6FO)^!xsktIry0uhc&%o_&A2z7I>E-G+sKqT@X!>bBdi|4?Zoqg+4l{zuky&H8`l z|E}!pJNI4b{nqMUDJj#NjOnQ#?3OJ1+xe&J8~@=Qc})9Se(7Dg-5Q{*d|Gi<u)pyx zvk!YcA$6dB?bl;DIhP;JU3)>*^WcwmmgUCBFD^L!XQS)nLw0+3_>@XSy;_@ET^8@* zefn&}X5%&SX)@})qT3c;FbtdXd5_SigHMw|wWP@P&GltRo;97G%2cyfXy;U?Wzwqi z-MtP@wOZ*nN9Wq3<EfFtaY=DuOBK1z*?i{LF7u1|*^{XH*+jzV<4@kp%je(yc)nkf zr@vG2@Uv7&p2)>J-^b+{=!h$?db}@(GeI#YZrSE3i?w;%q|NhuW?Ge=>d}c@W3Vv8 zhI_7>wth3eqUqcA6@m}n9dzi`IjFs7mrYCi>wtMCMJ&-y&gy|13XcV~D=C%KFdpl9 zlq7LzvJda&8}*hmj6xqjcrKLeRw9=0>dMAXvkEG0cvilApsXhQt0Z2$Nr59=(Nxx? z<hsLeB_FptZ{EB~Fh8`#;%>W0c-6k^3ubY?RkQggVD_}hYUPm@foFjxdv63)_aDyK zc%=8VwcO1OAC4~Wzx()<NVk98v}udyZ+H6s^ay*n4*!D8i^)z|Rv8?#8(UI$)Udpc zJGkoQjh*u=!?rB2Xg<5=p2nFM5kj5EHhWn0U%h#VW1g69`vk$`ez8_f>)$0`R*|~3 zl%@B#VXpDzi^sp5FggEZMaHycStWAEez~{0Ok4C-b;)s~^TqBmL1qhoWr}dNp42<+ zeOtiQNK(gVX4&cK&s0AOl`Q^#cGIPAt(gnAZgsEx-(FfhKc+Zeg01g=#$n9|SA?~H zmGAlUUu<9e-@R|wZ|0Qzyl?CGYVG%XrGt)yA4>Z8>vjHF<{KwZyX&{tq@E4g^L@AS z)T8J3tEPO}ux?Mm+1fqJ{y+KCDgXb&ZYQPgc{TrDu33_CFSY8u@9`;rxpt{GwKeu% z_-n@YC?UszyFJME1LN%X8)Ihti%EBB-q7>(?0V&W^0u`z?08D;!_K)UE59oK_%c2r z=eS^BZx&y<vWvFwe&g7KSB^?NGANK0kD55=tk9poRU&6h`!(tsnAu{w59)_6JfQgW zjIfWp`8EaJ*0W~=_;2`ms7yKYeE#3JZ%>Q2&wRW%czXQ#TiFIS-$XuK^v+y8Yf}HZ z$Q6<Q=0+WUofCO#k^Qu_6>sFL`DJzIe6w8k=kflsXG{0)du)DQM_g%N=)U70&KT$L zp6*LMBsHxv*k1m}YxP$<HiaGDBE9T&{kuEcGJoe!>esUh-}vz7ZGK6f^Bd0CS8aa! z_VoNaedhaiKde;O{2dxU=SqpdrYmbWO*iN$Ny<%<ng5l!vqR9n*5%>NFrK3k%5JBa z_<1+{%ww<YmElVk6+7baoAsIeA~B&(ljB^6e+uvTUH4q`e244t@`)zG;pZMb4SMs& zy<S@L)q<3ZYt1|RW-C2^*!JR2%@6rK4u+kN{~tSc<`T!E!t7t>^ZRAznX*3e+39M0 zXl<k6A4!9+r(WCZ)cjla=~lk(uHtKJZtTu``1fj-;>3c_s}5&6zc1fgYN?pmGUYE< z&}Bzw4~^UEExL<1%ZtoP^vp6B@;V>Q+%jk58=rpN-X9YU?qvuY9+4_M%D1h`_4b)N zv$q-UjlbP@%1md?HnmGP8ox*^xn0$z`8jsw`_xS@AM)r%^-t*IlUugpr`>DcCS{kB zjt}-KrnX=E+{4bSzVYFN&E4+a>hpQt-n(@w^rN;uo|&)ayRm=8yu`Ajcedvp{p_EY zKHq0UhU>k#pFh0cUw3-L&P^ZJg@<#_e)svw+Z+28Gp|iidG>O~rg+CJtBeleG}X@? z?rk~ejFc9<Z;C5f-k>dGXyu>LRND3BP08(-m!5H6m2CABD*O_1+-kO*9}8>n`*Q{o zEk^^&xhKz6J+vu{H*LGx=ask4EO+^CyY*2|_H2<9!R6<wkL_`PJw?*fUy{c^k~vT0 z?#1uxOe|CmRa-546OPevKD57Z^+er^pR6PcI7M8FJGw$IFG}%N%jQ&a_}FkV>e7|Q zrcb`tx;lh1e?GjtNucF4htui2!1Ekyw+bh3OZNT2pLr-o#LwYN;Eq{skxHE37a6@4 z>^^*5HApNj)1NiQ)b-TDWZfz2mvNdW?UdA+q#~|qE_FbyBXEO9)Pxg?D>IXFWVUV& z)=8gwWvk*JmYo5tvt=gDQag6c@50<~VNd39?J(r1Pu}D7LPE6wz3+jw?VptMM$ODp z)?xeX9acdGO*14Oi#i?GXygXj6f>ve)s7bp3U^vxb4N^3Z(p*kv+%)+^|A3K4g&9# zZagv2xMK2l^7FbQd#j)DHGQz_n&RAE&f2;<)6;QspBjf!z=L?cgvD#7u35HH*jK=1 zfl~0buF%U%7IQWQuyuukhGtJS;O#95A3V;k{&Dg44a)@<?(4`q{(=3*PbRthZ4te> zVsmc<n<R-{*K?F@=D7auzA^j8=jt!wo8qVMUVf&fT+!5*MP7b?b8YUAK*hH9g>wIO z4=gfYct$p>YR3Qj{kGK`UfnkP2OdEvT9bF?${~vfvu5pUQLWS|V9I>q(0aw>Vc0s^ z!)JVQRvw-fB2&esdiI6np#%B?^VKWmsu@{-U%1r#BKd+C!|j4H-Z;&p=h9Nb6RsCs zvFok9D6!%=>t6}RDn2VuGiA2BNk?=IUR_vt{8z2PH)Y4<=nH8o`NtO?zxXrw$y>+Q zp=bW7KH?6z+$Fm4$6>{k=?fO~m(MK>l6A9iT9=%y@{RGBor=qY=H!lZN48nz#Bnvx zTl(`@=$&8Q&s8ner|elIx%&AckJn2icduTM+q6>lz18Z|%Vl-W%x1eYuTAlA#?Nba zIxqY`%v8Ro^TSaIix*k4&VAONW~QeWZ*uNoS($lg?VfuaAq$P>@9dr(pi?3DgEc^{ z@|Bk1+t?{G&dmRlHGiEx`1<@DpEoRZac6!lmkvw5uh?;_;0wd@xvH}l8oRGa5fuKx z@Y}%TO+bLIAE)N=sgI9Y-}q%*vc~DArihO7!HBCb*)D%doOtG}wtk%ZXNkI_ebv{J z`={7^+ppGA9yUqX>16lj8M`wXIurSh&Q>e7UNS)=<J(cq4z8mICw@A6%t1AK-9f(( zN3ZKS^{^e*j#<0-a!T-L*;Aes%t4o1qCHQtd<xhr@H)6)3s2?mf<lIqmItcd#P;Mb zTkw~4P5v?M^Nh!HlfN0CwZ2uo)0yG<$z2_S{x1Umn$D@|bj_(1)L(b>|NVP^4{Rxw zuVDDU$hh|<o9&H>%Pz<kESdT8Xdhd<!%ipWo!b^fKVIW~`NRYcA>PYzEKBw}d9qsV zl#ZM9wIODGudwSJwk6)1Qa8l0UhO(LDb97uMD1nQ7n#HyQrTe^n6Np2qyD!i)$f1u zv&}Q+FtoY#-koLU_vhd1_TT@#cYXao;oTnvdu|I_YaR`@ciT51zi$PDpLPMK;p)I! zon_2M^5T<tmgT)Ud-(YB3GtnicpfPKY|fvOm3NcH+3MaZ;a8gs@?QGA`D?ePQtMCQ z(_h8^a;NA|o5r3z>)px{<~?i`F$ESI_e!><WoAn5N&VOAZ+77JgWDo;i|h5*20q*N z=8&ZH2{G&9<U}zmljp|FP0~KT4^N6eoT@gVH7umk;Hg82(X2HYpK@1C%=X*x=gdof zl?yE<Hr4(K%`!h{wOre?E%wjM*u!2G+K0ERy4$Qf&AL^}v;NhNR};L#&hGEsboA1v z1fO7*6<0du8yilGl~|a3Hn`@`noZAiA|EJ<h0Js<>#$0>&nmKYf|=WkDHoXxmvwfC z^cwoQEXnA}R8n$H_7N7;luDk};c-#ovWrXCx23(A|H}`3uHM#>(fa$+F_RfrT(%Vb z+!q<swO+s2$Js0E!|UwM3|3CgjQRSNKEEqwUM%VFDF1noJxeA^gtM6KYPiy}PBBf1 zQwL-CcwcDT|I)5uByrg#@vLup<iV|Tl7dwXmUSMQCAwqN=4TgLc`~|Kj+qEfT!ikf z-RXw5uTArAUJpv!+pc*h&4ue=ps!cK`J}3O`O0&jThHm3k}&W67H+<ZzO1g64x5*T z<psubGhKHdp1^i_rc#cZ&u_PTd;k34zVDvZa!(=ZqQw%;OV4bi7jo%Lx0};3nMrBU zQ&pR=W{FcAHUYtn@(S)QOH3O5zl%(YI@+VA6lAn7A08&hW~eCznIJoJ?~`S2g>NjX z*c&WFM3Sd7YHsY-Dmc{TeApn|x%T+kx^4W){STihBqjav4zp$O<=gf|=SPRR+d?nL zKabe@pR-xrx^R`dTE;Br$h)Ep;pNx;cosj-t=AXLb$!XF;(4~XchNtKEUAe~*KfTv zTjyMR^UI5GJqL3buPweOP<Fz7g`Kc<fa!a=c^3W7|2d1V&bOE<sH=Fwxbc|zhUIcE zyQSxE$>@2xw1inY>~L7uN3$zlw)#ih!{+Qba<6aqKC!$wH*fK{)%z}+t@Ezf#=4ko zNq+NL&fEt|+upc@*uJ^ODs$Jk=c?7l2}h4?dCc^v=%R7ox~P}$4PDl@?Guh=+vvY2 zxRJ{z>Ou5Nsfq8RvL58H)%A-Rm+jLL?%rn>XO?i+?Bn^+mn+VGUT-vg@kaRzi;pSX zzjWei`kxC-yPiH%&k%f9viiYChtlx7+S4wuUS5=ZOZm^{!#T&cO&1RrxXax0Qnln^ z?u{=6+x+954$UcfA+;#z;<oTP#k|oAR*S6vubf%&qW{AF4&~YkE7|>)oVBuS>JugV zrT0d}_RKQ7^5o$Y?-j3)RsVmbpSwu><k1!Rhwm}X*}C9JPx1AM>b{)(QxBK$dDg4l z+xJx9{O$r-t7C>q%$Edsd*(Q}b?(1$&phB})4XgAuY>x%7wXxfrQiLR$u3@K-L!c1 z5hpvFZqwNXpL=#(Z_Klq-Zm|0%Z&?G9ZlVr*WTD6e1C^R`07#()~?A5wU5p_`=d<k zPTc>5H(7$8uVl`Ar@EERPdcgO$IHAo9QXI`Gph^EN<N<{@_g|PzFZwWS+`_8wlc-< z>W@|lTL(UB*zB$I|BvI7@<+b}gp|YPFKLZSx_jbQ|K#d|mpg8R*Iu8fQd0DEkJ};B z?IBJwi<WQDXLLH6J2~-}ePPvxn>`X+7VKd)vtD$6rrpA;R`tEl`Wh7<GfBI4ADR*8 z<RtY-Yt9VA%O5R{-e3KW|Ib?S=NVZq6_>vh(lTFMl%}}<6-(5`7`1!r-U>Z0KkWWz z^|^mee{|2toV_&vP-xkg*e6pvKi-|ew%lOr9u+-#*@MiT1-p-O&1}D*lWSAJW$?4x z)GYaG=#{UFPITznA8HI=;Qe)a#PnX?OK0E6sH`e<yRlksYxEJ-v*HFK6;`S@xDIme zj9ROIVD;k+|4*fi$8t3Ko!nPe$bU;<GBDXa{m%9y_rG)6zL@s@c4V&4U%p?j78)Pk z$sT!i$D_92JL<iirR!vSWz{dt>#NcH)MC9!v--%Z%>h<57gYRyn)>ee%lU0@@4;My zT7&fy6(rguz8G>o%2n*!`tj4>`RZ?5nQqKJnw;4he4lAMyS&%o1LaP;=iE@3dtqmC z!!)tvD$dlfhhIWfTox`8{r#n5+v6jSCS?b%FfTUSFfn$|hgO%0%_6=133vK#c)pZ+ zef)&@BN?sb5*h~|mTH_oXstG7%Y(c1oKybqDBwJFrFU=Tj~^nRv;!w8+I(}1HMFu9 zJze5CJM)^eu>J15$mqr*nKQ>eTfV4getOs9@2(wpKG|Nmd*p$sja2*MPz}R}ZhLq9 z0aZa<{_owE%Kg5cJe|${jFbI_(lqTuS5JM8PI=-y<KVXt1yjN4`iq=7dXFE8{Umjv zEb@(N;=GJA2e@}8ZETt)Ct>o)n6ruh*N5FKclPPt`xmA4DJXsW$7#~7y(>B#dm`sN zSiXA6pHG1YjrvxkBwp%NZcducr4%l|&}pq&O}2U0wYL4Tr`p7IEcVDg@9#`s`2H+w zPmA`Y*nI-~{8m?#i*A-$I=3RUETm;)pcLCQUxOu&*IF&q`;`1(=DO++cg)X9Cs$?W zX19gU+Gn-wfv1D>?jOQSOb<y{SVX3}PGt|~b5UP>vTNA^vzKfYydQQvC`hU{<_XHY zxA#%L?}=4!Y#SHZSme0x`O>q-%J>aCbH?chx}V?wPGR1|`|qinc27|5T&<9;i@l;W zL>?76u629gQSsN@WAggs<`*XpC1+kp^V_bJvzAHz$cv%_FCAaaliWRJYq!1ASy{e6 zcfu?AtNIt0i@0v`<+$wDEiSfmpR3TT(jO`EJv0BYc2-VY)juKq>cPq4@4n6P@`Kdi zX(w8_B{@0FjF%*B`fI<~Imz(JZHp9%E8Dv5lRS%(8>R^)SIs<fZsz$@0g85K(zHw; z9X^wuwmyjUQ<5D!Pw<;Nw^l7Z+m$sj=jgxM9hKZO{Sz+9ek(m%pt?Hw@cGjripN7c z&mU-6|DEZUg__D;Pn(Nv%Y0^T^^TX1+<g9bY;Vi%8*lie&u1SAaxqwzS-7S3(Rr>( zK^&*MRvFYjMXyegs`-$A>o-0Bo+BuzImu%7H+9nk8`PA7SYDpa68w`^$g(eOPNJ{N zmN`oV_}I3b?|Hs#FHc6)#zjnztt*muX1i=DD0)0iU-8l@F`lOhdhKi_Q{GQhzUXyq z#xl{&Jgd`O>z<0t4%0hkvesiWQ+U}mnOzeYeYM3A%?p&OH1p}l|MqKk-<q^u^-|a2 z8Ox@sf5|N?@3?#6fAr~+WmCHieYJ1MeyW<6zeX*{Zsv@6|CPOzo=%Y6E^}tfqcd|O ze2$x>%e%OE8N9x@P-{oWOCOgdEC;8D)|iL<$&pf0V*ONmXYq&G`iep*4IC5~Oij%C za%AJ<<yGu&I&KF9>`9)ksIFRO__R`OO>cW!`Rvu#R~^nX{<XRGzsbhMdmriREPH%C zIq8pgxb1{>CpGU)65fA6c~@Rf-|C=CkHyUw*_f}9%~juBWxx5j?WV-X<>k}GGliG) z8yeOugH-Q#BX=nqduGkc{!;Mw<5$z(R?W@P(zlLnoKbr0*QO~6thUMj)3(JN`?dFL z+meE<eF3$rio`Cuf0=rCMqHUWUtUCPy0)$Py=$S`bNSBS$c`-Bx$Tl;b@j8mX<J`E zOD*=kzU}&|!}*0Tf1lrWrB9wINB!)xwPxv4ug%vK*Rd8}^osq>wK+fK?;7t(-nuS8 zBgN40?T!G6>9cPe=e=At^`G2r`K`Mm?!SCvw8A#|_u}BQD<o#{tSRYz)7^Q}>Fn}z zX}op!uO=NkH$DA$(uUr=+w5t@>;@aO?ncdi9$k4aChp!1{ukS?N=!<LmfHDCK$j)C zYNl^&#qM*<<V&`tv#rkv^*VfE>&X>Y>T_;quRT@B6aA=Us)O(CiCccl{YviqceG2n z_V;|h|9{NYi@%n#v#DqAuS`7rDk<^r$ys}{)#J6+y|$}88!Mu5#`xmwsWE?ge{D1W zE_TNv`=q|1yhZt5GyRW;7JjO`Y`NN?w?xs8V?s3F!vk{sHhmv23QA8XtKTxgMm@>M zt0d^8@ZS8KbvY~F?@Zfscgm{&Yi?irX8ygtE+aRu`&~!vi5C(wZ`kDie0cL>mhbBP zd7Y;<F3P{C`@3_?XWgYwb<JvDCsZFinxLH|=b3fu&zn11ie-1#1x*oGpIy3ineFV& z`{#b$bo;hS?}b3aZ!K|~e7;YLy8LEKZ12UtAC~XFU4G(wZiaO0v#sCeY!iDP-SyTj zcg^EV5C0sy)7TihbEm!FHW|x}#*2>_zIY>aYQ9yyf#Uwn?|%g(CLMXTSs;18$+=e_ zPR^U+TlCzdWQ9-P{_mHv`Qr<tFNMx{ad&=<je$Yt*`iZCZO{Mz@hMopKL5_l+OJc0 zJ}(dKf0J=h;__)9QQbegez7kvnA@)N)gqs<5Yz(DRdL!pgJT}&485r#d3I4R;}vzJ ze}*pSUHk2s(Zi@qSIR1vp1k{?@3;AmqHp3(FAl}bOPu!a+QQE-cAsCq{$#F?bjdST z{vY;>l^64?+$-AM_(J`R^S!jfhaV1T9{5sMJoAG^d~(jelB-vHcHR56P`*^Y!gam( zSJCuUr~4R_%wKRd>_2zT(?5iNzTmf2_F=nSZ)orR$<&rKD}7tila|0`UX`gAgTJi_ zKfd>^=RUm|Qk!M9`&Yfz*lKzEy3Gs*p0n>%zw7QUc=5YMuH^KWH!k@Z(yhATOY4@e zU2o@@u2=Lf^VBN4qN8)4+P#ZjZMdcMzm-+?an9=MU(5dNx_0p7A(tIWk@J6g-!$5N z`1tv#6l;SmlN-DC?~&U4O@3eYf5u7OXLHS}{cPN-QrHfkyLDkN!`d@Hmp(l@BQ9;@ z%+PSZ_}JM3OIK&u?(*NScI%(KI^Q&tvKKzK&2G5~+Pf<rt~UIWmg)Ie`T4Q8H#biH zpQl%U?au#r<@k^%BFw7#GI8I}Kehb-w@-8XlBJ)!ioFxgUpaHUadA~}`RjW&=Z`PH z_AGqSllAvjSI6A{nOUHw(c(QTt#()1x62n-Mn*S&dM|&*?pw{d=YR8GoZ7AJx4-V} zC)?V)XU`qXK5rxS{o%z`XH}Q&uV1Dee5O36W`BOl*<eXf`{CctzptaqGk?|32))by z_nPF|39EzJEaE@^*=D7@Uw&z>t?15`o#uM+Z{9L+$yG=6{@BA7eLFSQDa6tDc7Lzr z`~4H5uj`9OUVdzv@nDyVjlzx}j`x4wSN-$wTW;ac>vEgqb@_4^Klq=w^D(!ywRTca z@)_2(&4+9*E8d;yIdj#mBuR5u)#FDU>r*yp1;61cWqJL0)3#Y{`?v1im63bmZM(CW zpY*)T59_~QEW629(o(YNLw@w{t-n@W*|B(qMeR}_Y3VeBlp0z2);Frf79an#)wecJ zV@R(0ximlfo7d&=_T*EKJ#XB*ke89czpnSH)ZVzo@3(C`^=j=Wi)AwJUOdV54a=XL zzwy{>(*uuZ6<NsNz4ylShuZq7aqCT<UXy6b4!v2uWRXp9@VB)e8`(F#^2wgz&)so# zTIJr<eYL^!b3Rl_FF6{vkY{@Gsh1&7!?#wiu4#S3(Yhl>Z)%k7J?o&vSN{qRi#=qx zmE0UF8!0XC-F-EUEqdX!m6KEq&xZ^5pMF?SH7WReMDyyFMW=4<O?BE{A;af>>-<~& zW5-uLkbG%dx1)T^DvizAWx_VWuiu_OvGroYM=2enT5grUxqJEMzsWXFbK7GVARcBe zdTyuerh-}5G%i2fBx|wRvT2H1enQWkmCuWvzE851(bYe;rRm7AbI;$3uDVgN^K8hg zA3r`6&y&m!{rHi)a#P^Cl+rb44qnMBjPwe8%Rgyt{@eTJRiCdNp6S2G^5wM?`_@V9 zJEV2<60^2*mFH4TqpU+Y+ZLGZI<{unvdP)=GK$Sp&#irZ>3X`}OszXVd+r~!Dccj= zoq5u5*~@$0SH!MmJwL}i)q8Hxjg&}F(PisJkh{;QqYtyRe%R`rjulo?nq~Gkwu7VQ zvDlM+6>~Z|rrlWM@Xh|EpwxwZx*Z)EFDq3SdjFHx4QZL*)#s(lz`(%Z>FVdQ&MBb@ E0EhJDg#Z8m literal 22342 zcmeAS@N?(olHy`uVBq!ia0y~yVEo3wz_^EliGhJ(v6sL@1_lPk;vjb?hIQv;UNSH+ zu%tWsIx;Y9?C1WI$jZRLppfhl<jcTNrN+R}(89p*i-Ccm;RORjsR0ASs{{rHs~HRo z;stYd1==t$gdOp8aSW-5dpp;^L-uCnxAmrJ%i1-{(jVzxo_r=<)8Nn{gN5SG7o6sq zG}h!9m`QO&@U&?36mF3gWOGZ{U?%1jW|Y`*piID}dtR@gGY{`Qjos&x98RBGW3~Ea zs(#u<@A~s^-Rr)dTe+(Gb^YApS36CD?(TYizIxvGEARJ|u6lJPyzcw%`?`0Y*Z==s z|Nr;?|G(@1J+J@cm+Re_DSG49tzAV=PksCLZA;pUGR+C|m>g{E+uPeMx-Mlm=*;V7 zV)*;--@dOAxgLy~8^Rh{gWtS;n>(jA@9wVF#V?*bNy+t7oxrqM^TU&qlYf7IAHT0g z^6<^Gv(4RChl_ePUJ;E@`uF39M8WY$1GAv~{x|0%8ZTcC{vbQ0{>O*JV`oDyFLCJS z(h;nGd&^WoPT16T+UiA14mfZrh~2z%C&a>N!X7O%V^*<_9s#ktI|`LIx2?3?srBK< z$K)>&e`aShU)9sRu$YPaOwp?|+ua>QuUz1I;3Qb3qbJ21JMq+XCP|GAbFLj>{QTwR zWge-;YG+&+??f&Bd~W8CsIzZY956m2FDqNB<8gE8fefygJr#i+^1ivDQ?@WU)m(Zv zd*w%`KR&YS)6ByiI`Y@eEb>{~AYi|hJ*3`<i{s<T9bRp-n4I=lHH)lR*&q-ftfAWN z!Ki4blzw8$4pD(ekH7V=(GGU#2;V<}$y8L}Q8w4o6hTdeBkoUlW(sX*a;mxWZ(?cJ zqpR#o9N1Y~e(*igeC@)e(KX+rB6RjVCa0PzyU9nL_WWwVZTjUHko1cM4FdNaZBplY zFuHye=3Jk3Iand|Nd3Q`&)@I;esAgK^H*1g+y8trS#it%H=EDjt9&jy<<CWT`Gvd0 zLU~dmxV?)`DIIzK#CL0I0P7?dn;(3ens+)FT&eu>LU13O!BhXE=a<i~i;53WaXabJ zANtkt=P${bmo}N7UGZhLsKBGE&PyD8LHZuZ9l28e{$A>iT=|x7OHI@_t+tb}F-Tx| z!MJ$;k4N10X$w*W>~A<PQ?}+xEbFs%HQsSNyk)%x@74ub+G5fxR8O3n>(j$;bjhsd zOis??f_%=)#`<SJ-!}d2WplFSM@5aIw^F!*=aJ^wZJV`fqZQ`4{Cm*MZ&0VOoByz3 zO98*#jROUTY(37*ouhxK&QJcL&6|U-!<sg-pE%|h)-u0lV;IM$OKg0x(~jvJ@l!dr z-lMZV_YhZnppG%yw2IFWI>I*^L@NEiKI8nzY3aSpZ?(g!j`g$h9SgXoJ#>zlls!S> zqV|5K^>;MRt^GZbd4JNg<7rVmA2p6o=-nX^DN!O_;F*4Cd<j_rzEOAEP9_#8E> zb8Y0g^l_ufzc~$udlc`fn`O;b-S;73cI%R_f{!kLn!aXkK;s<&{!5LKJUN2ri)LTg z^7jtMvumph&UDH;?`i!ICUyGbhpk@W(>>SU77=!SpRm04=z7P@ux|Uq303Em7ydN+ z@Z-?xZR&4YeOHS;nyt0$%jQsp&?CvG4*lj?SRycWa;NM5u(L<EJKKCXRk4TrktM&d z!aehLf%Tmg^A;;`t2|N=7tuR%{#!=);q(;_lRET|tz}3uc-p(ZSHR!rw<cfQE1pF^ z9(d_XoRXZhtYdrEAD3R&k8_H*zw7V{6nwAzNiug)TQke!^7$7t)@jtW9p5%fhjoF& zq>l6mubjd~ho2qUZ823`tFm4tG0MfpvfJz9<k+ceoos|}8zhK4`^s=mR&t_k>rIC# z{ZTX8Quy_jiV2>Vvb6Y^rFEXI<%gcEbLCQpU0h4LDm3~6rXQ^Cw!XGnrp+i&!8vWo z!!vefe`-Je=zQG8de@^NclU$NBW0$dtiR^#TySIRKAXuCC3r{ei1+Rj@A9i29!Quj z#&r9~)a6nuW|h0Kwf^qvnyPkjs;T(=mf0yOJX|V0KO~-HCpu4mzR;mY+CyLlySPe} z#N-SyMZ3V`C*OP&6?k;~+8*vlm6LhYSKiWHVNjOczS6%#-YtCUtc6TYHA#L?MVmzC zhrbHUP~7Kk7#ebqi{oSEZ}aolI6qeY3SBGZz^GWq5E%O802jwcX6`kQJ_kB<oIgJO zb7rT2y?p%YrLv+Y*gwvgw@tmls%uhe*`40ttp|#V-ikh&Ts)I!o>yayK)<!mH9dRF zsizFD%)Tt3apd@g#VO80Tq#Wz=k@h^`fRr?*?qq)ys4G<$JQN-to|Oq9sZ_P`C!wh zXURQ!d%W**9cR;Vbi4Prss87mkiw~z`wMC|bktmE-?48-e1Kg9>%E*~ZW}dNK2_fF z(m$fkC@v}4%rsL$&b;ULrMESY<R_c$>7K*?w|I8L;qYpOX{Wyxshj=CSiN-1*1J3J zHN*$p)1TQ8KXYR1h4nWKj2Wt;9);IG;r+Cw_xsLh#iif(Y!=&gPHNMkX9>1dPWBNe z)!X!L9AZ=4*P3z4$e-27(MHfmT&Ssr%jCwh6kCt<&EJ-4uaf@Wy!CG2n)R(ao@l#7 zY)w^pl-tU@&hETP*lvBB8`}yGSuKrUF1K|<mXrO8U0JqODz86X2@Pp)7m%N7o#Jx_ z6fg!C(>(rIO$og%)_j{Q{-9QZ&x4r~A1>}=<L3OKaqm3G$JFXA?aV%*50@(Nok^Y^ zm2J#!DZf*ky?;h^`qW&fny$FXXD4eI1Rp8pG_WrWJfa$KTl`V(DUO2{hkia3kiX$` z<hOKh%MVXJ<4`TuWkCtcI-d7*?f>&4yw>rEuSnGq_S0K$*L24_+Ra$8QRCkHl!9k_ zGezDnZ_eOcTrpdjD@Sjgd;gbdX{+vC3*X!I=yy=i)0FiNY8~4(zbfRdowdTzD2~sR z{j-<m^_N>a>}D80WcpZkck1QWEPA{jQmfWXKB{qc`AXx!<`we=zQ4ZmnM+qNKCAd; z)fbQV`c5i$H@E&+a##KF@el>!Ba=^yoLm1kZfkFfot~QB#`bX2x96Oq_3y<bai98K z{h=~g%}y-7c*(}r`i=9yZ&&D@`jUJ7Exv0j(-qU=R-Toy?0S9iuu6}Z?Yg!0Y397I zgdVAj#D^|l>Y&!4zWBBMUd|=IW*5x3yZ_PRed5#K&;9i`d#gL&WbfR#!rMM_!XFEI z1>*PDYdt*!O5;7zuXjw|tm^pafv#WasYIzB?LD4tm(`N(5~H(<MIT*!Wizi@=+WzP zzok={ek#n{vi4<Qy>;?goz;^+hE0p>l3Fq0#M$gCS*{;@p9DR!)Se*v==qxyky~Rs z=1<*y^@bi7$H&+!!S^yn1RgEF7`s(%MT5Zn1((zEHwoDP)>B}7rKND>dZ^dSM}ZC< z{l~>OsT8rc{5T=2^4Uv7;L%lGP%YN-W0sR<qzf0vM?p*HWk=RF2*_`*Pl=t$<h18k zEACo2SY*AO0;`pV!jW<T|48*9hrmBBhgRSEA|mkU^5>a4V&EFymlfUg1I9<}Yk!&K zS*OkwsaSX5+O=!F(&kG#L?$q0i$*ZKtMI(=_xJbfYN1S;0?kbB?(Q!(mcP5xc~Ih} z0;^JZLSa?au8kWD-`?7Kf_G|VPy^SSw{ICg_RHH(QwVb4S`(VkC}N&}?}(xCv)ww^ zW-Vn2S`fnMqB3LY!5AAem5C5bl;*Yb+Wr3hJKI>JQDlZ!<KxGV=gyUFRStf+zA88* zp|hffkB_gRLdM3T#o%;jN8N?<_WwWI*Z=u=ygAJ9{GtDU@BjZB|Nm?J=j`9j?ED3_ zrNza<le>21O;O57`5eM!<7|`s^Y-@q#~Ms8zD{Hk)Y`CncXdUD#npw2s+Kx*aoM=< ziR@pTvBTiQVSam)vOOP<N&o*j|G#BS>}IW>)A#>*`t$Si_=<<E#m~<rGRGHZ*_|^A zw%L`kS!6~`qtFrl^vj3a`44`7`!@Ga_19OSdGqJY;R%22<8^HAdW*k@p0C}0@7HDf zzrlI0Bim<I#GjqQq%9)B|M6J4fo#F?E357+t8WcE@S~46#_Ql+wL1UTNmB#4JQ{gK zBsf1Zp6#qSp?<3TjWdWfMe|g-NZ8G#4su*QEfodF&!3cd)ca|d@1ofHN408Z>d77E zr(Q4IR(42hy2uIV#)$&`?dSe(){^^pL2&=Gh0lJhJ+Mano!Is&+eaIP_rD4{{=+Y@ zH%LK_)y=8q!UKknA5To&rONmyIKS`Bbf%yMi<z8i+!-IA(mQheDSxCg>#{J1j`_Ek z_g>RK@?C2=*JP%X+6qV1-#guBP_)x7Uu77yU^A0bO*&_?mP1GXN$E|lTt4d?1nl?n zS8Z|VcpvB^s>*5<kRWv=`KQQQbyJu3f{)q*LQ}mOOGIa|eSG;!bmvp2nkRgdDuWVI zSX+KfWR>4$rC1kH8@fxx!<SLf&a{8+mhg`Ar{-q$h`d<SAaFnO&<rktN6DYsawale z)>b&;|GrsHSKv{#NU*DCBag@owvW3Or!82ge1u<RP1jVWPAvo8M_YMrI^1>bkoSlX z)n*k6b?ETFQus8D`(xzJ;NFQ$b43LnS$j(aGdk7y+?${qlu*Um^5bRgg~hB+HT_Ae zG&CnPGC9?-`PJNGA;HTI9p?{p&RTKuR42&gfsCNKdAYt<;GZvc6Ig>3)L2`7%-D1B zrkLWs%`I9ETq#Q%1m;h*ZvC<5&dOsRjpw*HKF(F`S;?Sir<Q+0Ow(X5(`AK!=jK}X z%iGV}_w{C^!jbgnL8cyDB|!;NN6L*NXU=8%{_gJX!pFy6zSR6)c_dlA&WVXrjdjU^ z98rNsm&^V(v-5ArdH(L5o@Rc>@$ffC{I}=d_uJjNDUQpdk&lbxqwJAxW$m=RJ)d0m ze3T8Wkuf{PrK!NWEYP82zT5Y@Y|~Tw|9-nIt{0Q=M{nPE?M+^jnKZQ&jx2w%RcN;7 z&+xd)r%$KHi`_RaTs2FP)k@pI9n`IPsPtrO_H~1`6ECv|n>1M4MMp<lZspEBSjl;8 zLvwTUIoUYYE1?fQd=QxB{PWDOpkrqrCNdqbl=pA`vGS0QPmptyxVc%vf$$IS&-vxm zuix9|VYl7w?VCBbZ#{a^dUN^Y$&+_Y3ECCL<?t|idtTs&&(F{2zn<K|R3NsO?fcC{ zBmE=$d6&(PofTtK+coXAzA9^9UqQ9Np6_QjzdpJ4#!{cxq7B>b|GKulg7LrozsL6f zyyq_wX*gY>$+uXDf3l?FzlVq0z4s-biz@IBZ~R;P<HNJFvtLIp6<I6tz*Y86_H2=x zDQ~8WH2gjnP@eAAalGMM`|R1z*To3lpB(<+7;nk_ghLxe&rZ<{VVJ%$uIlB|{r_I? z7c&YDXYjjo<A#Nu-8^rRe(loJ0{{N~eZn|BkKx|*r|IjC7{@D>yayGfj<@IkeUrYD z+3(xo&Vr|x7ViB%$%^&UuE@DlYM1Wh-|={{=8t_A)`^zOmp?Z%GYP+Zec{8?4@0lr z|MSe;DdiQ{fzCbeti+ELw*@NJ$Z^$teROo9bBkhyRN~BluUoIjdC$$;G@r|0lGvlt zc;6~eyO5XPsmAYcv%q}0Tc0`(?%wXyA^xa1>7zrg;G@<bA)*40T7NWdm=V0usb*Ef zYdO~CaZLjHN1h*f)Obtj2=~X8S_((FKQbp8E>BwSViU$B^)uIH*J8D=C+^<XKf?Xd za%07UZ9bhp8m(S*CAC&4*8Pc_9@D#Pahk#{zo0b&^Iw^``fbR&F6R1?nODx~kBW}m ziXg?f4*yU_#kdZ6j&4g)?IX*%c9c!b_uJW0p=hTr#(zZ&i-I|iK9+$UJSV~?AbOe0 zpC8)3+x9Ph_W8WHeC?JU)#V?bcv{OHo%(w7d9nDKi_1MHq?Q!6{8%CI|MUF+f86bV zUHtui|NqzV|Em<DOtrp=@BiVt_{-AHYRx0ld1@B~l^=dJUE#>}jz{)C5(-~ldNj9O z?9Ps=t^O9<qWiz^{Vq1Y?$$k?Evzo<R!M!yzv9Lt@xx(`zg=d2P_b;wj|zeR&t~WE z`}gbhkLl9(KTrC<GG1|fibUGJ&vV}|a9ALjR-#jxs~8r0wktvU%g=}W^%2Ik`X^g{ zly=mA$>=OSAN)bE<*Ub`@Pu_7noDy0)<s1!P5!l(wb%9M*V8R7y=^VORM-1x9&vA~ za9O4>{UgVN*L~N^N}L;fysur_8T->wZ}qyg%n3`sUvAnO%Kh=R0Dnbd*RjoPChS-K z$Su+AT^ZgW#He5N@kzsBX0seIj?Ydqat0L&caE6}MSHzD!d^W?kTXK$U#bjmb8g8& zxg7S(MjDO1TDtO2A0(@8sQIJlm%chs|F~sW^QxNye^TBa^8e?uFoGjH{bb{zug4e^ z?Szhqdp=+M<9+S>>YjJGO-#;AWlA$xKMCAON;;lDIkNoyy{DXv!Xl2}UR+fEb0nBu z#f|CB!SI>@3&HankB9fBY`NxsS*NQksb<rz9rIO_l{L<WAJ@4Sv}B8IhE$hpSxrGm z;_UsGc=GE5Ix=^JbzPkz{^+`5UFja4O^^8}Fn!s{Yty*=PFma_(d3#xE(@CTcp48{ zTU#2qO}@)wUZ?67Y1A(1c0ocYVhXR8ijL04HwS09{F^rIy?;zc+O&MJLku+^M137Z z9qidHRW_GBRL}YC$g#hOt0VOGNr7+M7wr*{=X}(duu0V7a|cV6gJA=|v`6v^*1H#K zJ*@tCi51W8tdu*js41A`QIDz7bbp_DO#2*cRykyPoMgF?necQ*;?>BcC3o)MH&42? z(jhc6Om<VjgbmX!nK{Yy9BW_7cxMIE|3~Vx8mE+9N^UhUd=sgCG;81EaK(Mhk2<6N zJUq-RB*wx0josMHMX|%DBr4+#<5|W7$Ir=l&$z)R=Wv<pqp(hb_Twt<y{iTCIoH(0 z_sJ_-B;1flW-XG~5LVFq;Mt7yJI{Zx-(Jx$H`?IadhtEcMxYp*Y;-{EaMmWdYKiAk z%{ffR-TyAV-Sbg5Ss+GyXaA8S*;ie7y&mvzHlCi;7&R;0boFDw_tHsABTHq9aw-z; z_#XM)cEg1?=+?^4tB0J{Tn*qqdCg1lNc~HVjAD1+Op*5&eFV18Te0z`=(J{zStV-k z|CG3EKFZzI9IRTG#Sysec!ubsT&tyAAI+)?5Bmjp3BFJ7_1U$k&4!=DOY9MQQrY1o zYrO=ADa}6`rq5q&K5eb5O>_Kz&Ua1+!~6ZTH}E}bo|G6`e#H0;zn9vhy-(XJ<~iT+ zxzaT;ZLNq?P5KdW{dGlh$_i=0M~Wvr*gNA#fm8EmV~*9jo8r1F{N_burb!&{T=ena ziNL5jfup~FyGWL^Ur*NUT5e>f9okhfqicq(#=@(zbGjZ$FWQ~=X;}w*TT^sK$2Nw! zy#nt!<K}epr~Uspb@H=Pf%nTNNtAzYs*rDpwuo=7I48I<R&0;Bf7J$c3;v8k=T&N1 z*L<%q6#TgH)xpn@y<Fze^&pSXyE8og8F8oE+lc+WF52;&W$*m1hqiO&9+f_Ow0cp+ zEb$n{2;0EN={X5<b}~O}6t}&7e*dkJ^JIs(j`gSCw7s0AB$u#tWwF8O^R>5oEFWJ> zusZ5|GrxG%t<TeqU)Bj7_OH4jv03b68gqK}uURV+54>Bysp!N?r#<ZE`lg#R_X(I~ ztrh8dWbOX3q3^Ehq0Uy(@+sHVr`%2IXZl-WnLlr1(I4J72bP|FSuDgh?SR?2osavi zC-z*okK_<$G4>A23H`Z;$J^nu%KqgNM=u+k+y9xry5?b6hiT(yr*Gl$yY4R+frnb^ z3C-UT0q1v0)p^)1s(EY1{lvueW$d>bnVdRLw(pK<Iv{iP=H0G6mUC5$(=Th>^V<9> zqGRioWy>dQDp|xf`KyVXd|ZK<_ZorhD^Z$Z!Eu3qc4^$Zz+5-=-k*DOe9v>n&AGSn zwxqOZw3Y9b6)jskUvJ;5rOLwNCe_DvbZ&O9rMJS7>#1djOLPVNPcc-6np>>nHS-o; zv$wk@w`o;X^W~<pXQIUme|~))w5msc>)KN9)*rVz)*qj{Y<sJXf4`=J{bi$)(wEcq zkC?lZ-+i)H@V>Z4s9!%9$H$8b^Da9oA9?)p@Z86X1mdUP<h{)K(N?JJ)1qZAHHZ7I zJAX1W_kG56<lA!bjamvvz882*5mh|mf9|OqufU_losW`LGq)r+3+NyD-f<|VTL@kY z$Lze5yu0N`34{2W+H2ld`nef$^D}1J>=J*}`om3Q%kOIwxxdFeDs!vm;rjmIcf7Qy zbY+sFo#2tjX{Qv!lAq6-xVJ}au{fyG{`!$?*=N7v3v<dBf40=L>uu#XYcjp^N?fkk zOVN(?2=kG%;V)Nl=kdrn&ynZxuThNaSbsjOy6K92#nGuJDo$HoKeQ%3K}&PF%b#=S z&h4%K&h~2A(xc0&+<iaTTzR$i`rC)mPaY+&>$xns;d5Zb{x>|^+NJH=SoR9oU)VVL zzN~2s>*RoETzzaA`%NSS=Ep18t3HbS?r_&c`^fLm>>S4O{oky@^*5-pG;MugdAQkW z$ECjblXE%r))g42%z8a9Zp~)L4*3^1PV#@OS?F%~?paa)HhIQ<XKybNTC#p?a7TaL zqGRiIePp6}&TYNk%%Wlu^h@+qQ~CR!M|C38n)+inKRW%1I$+qye^uA}KzUsA+5B~G z9sP1256+5Tn!Wz_Ofm2G;VWHY<ky^kw|>*IpCM}n^p9+Jvk4dYY;2~X74cwS+QW(J z!jFR8YF^%Y9oq5zu*2E#S!-r%z05wfG}h8-k3hWe`lA|h9s1`^CMd-P*36&lRs6B^ z;<M+cysyV?uPk%8sedAGdfZPX+jGYXgzoPbynX)b@!rz)GX(BGzxd+RseHY8+3VRK zI~KlmtKaN<_Mq~=l&(jM`yU;Q@mclbw^aE0y?Mq4bvw&M4uu;P-Yl=?xA?{`?CA8z z;epTc8-E1)v)4MFiQDB?^U_1W{z!PV#*yU>6&H5?XnOxBcxCCd68&Y2@2V?Lo_vwq zyy!=xTkjtM`8_{(P3bJXw4|dN6#K>#<TI8wn&fv~Pddc>QTFJw_KF3PlMR;U_kSw) zN!!`hC@`Pnkznob@BhDw8YR2cb(9MJGRjZ2?0Uq$sAgIR`>F6dpZlV-KkZhYw|F{8 zt$SnI-P8LEC6teFf7CoTrzdB#fc}x?s~QCKkM#GP7FjL)D3~=SO7OeDHLj0NHC<<9 zZ$8r$v=3m94a`|}dcsjdLnD@DyQgR#;V)r%Y9(%O6s^3{uOnP!{wgLXQ042EZ06kI zFIo`$=)TP-kO^mUdXJdF+lc)viw$Qhf*O%FN+0#sf||24Zc26LI_(iaG9lUP$m4(0 zj`z#+U-8{s^?LHV6`H{gpj38I*3?jW_sZO0rMPa+@|nv5;uPaL@=xuSTqgb~c<wTR zN1#S++ljneDR3LXvh&3sy}!SIe@*Ml%gebMCx<`y^5xDkwzOXMLwDwM?=5{T);9^% zVmD?<O7m?Ket2rBv--;mkIx^qul$tK`J<hGGW#6814(n@bPUq`FO_~?_eGI!!ciuD zqq9Bb#yNa*D%kd@epLI>)Bof0<;&vcW@5W{JJo#Rn&UdFy}ezy<j$SdHda<m+w6ZF z<WD<s<jgD{^+Qv=+x;$O9(T8yRr&s&E$gR~pZ`91(AwMk`uckROZm?OUY?z8E_z~l zUv=Au0@bQFJp%m>|Ma(QpFU-OZFOPQESooJ7Rkl$<<cJhPsx7$<3|PGmbpuM)z#J4 z@B8(tTYuk=$MXLzN-v$gTxaoa>GZf=1rM2GEcK5p-kM>ocUf0+f5aT-cjaY9|9>yG zkNWd-{__jRw8LL)ojX_7_aaYkUC)BuGcMWuuK9iY{=IYWK5t!L`&Rn?54W<jx7s$p zFx_$f&;m)<k7WrDa(gXWcYdnQ3J|GH3VZPB>1m1C-@kopTQ>WYIqL#56L$9GcM_Y< zYBQuCOg(srvDoF03}3Q!WaZPT;TJdy5^MR^hDk3yki}XNv**vJ)6dV(Kh72wbTZCR z(au?Xv;61#<@al+H_p(Qzi|20C2CwBIu59?JzKdxZttnbO4X<Qn=9@tT_<@}ZSH2r zsK>uQd7YMgQON2vC4a$!NzYa^e3acD8?&cEP`vcbjuW##T~@F=t|#I;yW;q4+n<@Y zugxx$RpN3^Z4r?OY`ndr^PNr|`~5&&!SlcMCH~q}d`NI9c3bP!As_l~p|-R7G3C=? z-N$XKjMo`t?@G%MU-5@S)Zs;Qy5@=U{)!;E9p^13h(A((Ghy${CxZ8*7ixKMsjO>o z{n)vE@wA^#HM%o}d{vI9zp|KVyMoE-&w@{@K714rcy#=7l<CsN4FdK%)|a@SeIPVH zRN+Yf;>}r}-i(TM1@)Y^&E7gk`jt0kc?N(4mUDh2EWqs9(=AiM*&r(SqUUSp7M}MG zr&iyXAzD%O&5)b<$n)CFf?2cGT7NY5v46RH_N?#gvvKJ*cMRJ_E!l*^j;gI?kjuMu z<HiQ}-L{W@>K*QhXVp2Pez(;5F=M&HJ&pX@={3hU->UI$unS5E<9cvKEW-Sh^rMsC z_w;is+HGI=PSgKL_xqhcBi?4NYgle0XwSaSSzU2oWqPMwd*D1luWyB3U-%|A25KZs zIX;{F<D{80WyFnLZPr;OCGkDXT{pk}&++;rnVMFHpwS8Wx*v(_bVGM9aj0dzSO34( zC%NvacKpdtI}ZF6`IpDtw|cX)&9#;Pz4u<~e{<cP%cJp)NJVk=?*|VKoSXfuwPFp| z-$%!eanGL3y+;1;kB^UjNW4A&^ZgT*=hvRTwceU%!CDYAXWp~2jE1z|zbm@0?p&+O z6aD?&-Py4s{gPQ9Y8wUYsyFeM=d4K41P!q=FyGjky}%}4Xs%k<@jH<pW_=LUJDyPY zOy*JfN83+)TA!CRh`d;F;N?qhas7YyyTw0>P019nXS&d=RUn#V`MmA+Ve72rZ-N}S zJQ{z9TI_x*&;RZm>&NQqYVRY->$K|bpK#JtU|r(i&N|QTY0sY+f%C`f#diI<vGKmf zZjlL0D>VwfJ$ZaaV18GA%5sqjkdeVXYPm}qL?$rZ)KWN-{`yv5^ZrfVjG*x`VWoMe zlY1-U&u-rNgXhjNH4jEj1=d#@3P-fNrZWXOaHXtn5SYI<`*qKUy~``VWPH3=-Cce! z^3LAfKmL3U*?P40$cFv;g?7I(8u#z>;y$%fYfs(M_?nByww<?&uK95A(#7=eF|YOG zSX+Kn)K0!O@$*UbZtv;S>ciLT{old+X!%vHDDHiSf9%s)u24HwY)Wuw#aS;yx$V+t zUL^g|KEnUx=Dse`N9|VMetilMdaAJOFe86lMfS(9Z!YfoB65!5;|Gp^*UIE7*2+Gb zXy|%=ov6xw7N<YI4lCHN|9($t&W7o2dvA1Ju3XJ`fid92^Owz?Om(g&`see=91K_a z@#S)=(YZx8emZ`*`sz{LneZP!m8Lb=nk>%J>g;Gw+_Lb5*E{{cCtsO*H#JC^{a}i| z!MXXO-mQ4iwbe($w@Uqfsi5{Cex<DjZ`KF(9Ajmd4LxZ=3KmzFZ9O<4VC(+x=PW-n zwN@zZV`pWWGF>i&<5jK{`^CKr<=O2mkJ{Jd@Lzh|tf}y6t~!?vi+s-S^<fGJpD*vp zu~{(pPiL^_(uEp=?|nB3i_BX;#f-%*YOjwoQx(_c1m)xe_2{nsqGgM859UO?)S0k; z%PJF|Gd~`L=WMvARlQ;Uw9Bkl<o_EbUsTEV_%QjT#2a(ww7$oRv-FRAXV{@AGdW-; zgP7gw^%_F6+RS7g9?SdlWb<Tewp3@)Y(qDL>9wjmG^M;8^mcc7m>DLhFL|TxZ?12_ zy<L(g>hwW|)@r$*RVVGV=cH8}VXxu8^f}zQX6oD)oymnaRyY3;T^eZ|e#808?}rzv zg>TnwJ08P!_T%JIo|NT12kW*ix?2<I)P6E#8K`~_XXUtm)p#=xbFKb%34<9w^y*X( zHAVfndW<LO&<}~2XQmen=9wCEY<;vbd``Fd??&}{?k@M51DYzI1NX>h)~v|es%-1E z;Av=?Q;PJuKNVp)PKI6jxm&keuDEhLcn;sE4t}*wI)#C598F2xzxVb8FEqGb)%s&y z!|AQ*CRx{SX{?#CfQx0d;QN_zT|XH9vIVnsHcHMB)N-xaaNn3OQFH&NIS2T4>w<1~ zJ>9|<EXBJq(R!_nb?J&tn>miJQe)}(Zn)`ulIYrP>86hi-!xuS<9J?hq2`^=scd1F zYX$nri~E)z$p(+Q$%!0LjIx@Wby@19;=KcBoli&{=RUos;>77~avzs2H%gIT6wdE8 zd(D9r5B^tl1+-T5=rtzRD%NeaT`kBzc>=>Umg{n>avq-yzVPAF#X{ZvQxeuPIo0qt zM6WLT#@V#8Y}@to8>bmH1)KM(WnFXocr=pl&}lV?RgWUyFHYLv^UUbV*Ub(GU3%xU zJ`#1cxA_pXR#L#H=YSu_A%p!~A59MMtGFgM8)kmp>Frw`rZ8`D-+uFxLgMTyeJpq6 z&y;8C)hT%Sbo`h*SGKzPjfM8rjNVy{$BmDzdZNHru{*U%R(yNJkL*=*W~iO3a<|#& z&BwM~^xFItAFmfRb8jmPJUH)LlJrf1c>UliJELCHJ0^_p|MV``e)A+WMrrCAow+<K z?E{&WEej59(*jv89{6^amUM<%;_WA&ni(%|5S<d(ai0I<<Al4{m5%UtRFniPy0C0U z^Xt_ucK-`1Zr7G(3!c|hm?z9~J=|M=yON>idHa;@k{^_;yq`}`5c+mIw`or31Hl*3 zjV6Dx61T3uK1=>i%j3eAmw!iv-9CA+!Kg^IQAxIDskWCfbA;1WTSwuFw1inR0$6sH zYh3!#E%xk7!hZYTk{u<Rb;}NE#C6Dv?Fjywd2VCa)ws_qPsjDNOUhn9>G<tZx=Z-< zJ6rB8ds$f)^!(w~GNWx9+LH@HOE+x$a(&g`w`aoE1+ljLu(4eIPLFj-gGd9Yy{ivm zod{!8w2Qv3)iM!O!g73c+5;-46{1<yTx`@kkL`J}$~tS)+v8l<mNbZTye(QSp#Q)N zR4liJIt2dN@JnlxL=@wlpu4|!YwoafyjY~S@aj9?3g_u!Q{q!!b*X*$xO(B=rJvlx z96G}1`$aG|?D%r?T%UX3)x*=4X3yEWZuR|3OvbCY;$t=CW3uilrS=3cD#poLC9)p) zt{BIE+BCnrJ$rw^yX{-z1kQi0v9i+_Q+)O;XOh5tg9p#<6kaTgetx>-!R+Td{QMO7 z;*W+~$%)iQbytLi%sI2sTwF|BYu|A_hnf#7(qC4;Z<?+kmc8-1%(~u3-TDekl45oy zK8w{}{*3$MtFtS$1P*j)Z!ch#sL8o0yw9!K{$so}!;W{o|2vO=d(|nWtscSD<Gu9) zgIM;%f|tMF+O%e#y!HKFVP)KJXXC$bDidbJ``@2&)T{QCLXJM)9LtY+ZMlMvf?4nI zSZ7~I*>Lhugwmx6QaX>{9S+*hC9&<T`o1R}%!jj%NQXvhs;}?#>wX<6Rlllg|6E18 z2fw?%-}`w~A<*br-jU<_H(pL>i*Ee!;A+Far9Cn0D~>i9zpBX81PzpXY6<wb2>5Kf zw`=|`&P5@5b=_Z%uH=bUTKn&5*#5XZ#}~QR6n?GrW4Xwnw^4dcQorpy<uLC65q9Ql zuiLe2)+&`6h!`dpbc&{~s}s(T>Y2TBt5eOShS`<tx30JuJoU%ppkv2=1?@5NddlLr za?-IFy>sX6`?ws%;_bMe{O+;vZsxxj`L)ja(zMRMmB+fi-xHmk+@a6s{cUo7a$$nD z>z;S3Pd*b6e$@IyMRdikIUMJ1EqZ>i`+LO&w#&+^1<!YH|C4-2c8;(_ab*!hkn+E$ z2a?Y`WvSYz)cxq^K9Oke+N0I)TYlu6u#R$W`JuvS9`(Ot+oA-eCc!O{rz?fdToHe+ zT46cy_1fPzi=Vi1&Pk8A4SbxxBymQ+&cC_7CWpCJR_&iFzqDfIwDPQV74PqI9ht4V zX0Eeeq1WCt5&I)+S6uwIbPq4cbs?f36x7z|vfYete`3PD{zy^LvHks;KURJbUEjvA zTlVO^)#(?_{bf5sCP;<eaN#YCuh~C$x$bcl@8(?NGyA{iu|E3C{q2X9v-6(%MWwor zW+v?T-uvY2WsYcb#Ye|u8hT1IB{zj+##KFuxNtW9ul9F|L(zKG!f^(#b1#~!AIW8^ zauqr6J<&)0%A@-U?Tcz6c=N>W=O53M=iZWOzdXC?OBwSEt|RPR7d*t?X>(~UWjc8D zo}!#Y--KFYL(h)$T~)>}x0;DFcCq@#eSCD_(VABN^RvCeqi(%2ziL|BAA9*r&Y`Zf zYnjSF*4@s0#WB@O3e>fXXjEYGeY&Fi+Bwm3N!RSnJke_#Kw0X_&dTH+B`>@gd1jU+ z`^TrQnv*Fi@QAfzizvgSlH3jA9S>HmS(Z^1Xtc_y<;NCA@zC^1hCvQoN0uFE>9~LM z=Fal>_hx**`l3&&H$BLK>x_3Jr(pl?{IBn>Res%egGuJ5GV7*rhYs<SrI6O2f%}p9 z^U_|Qd*du*8o=ez=*D%1>*M$L_v7v6{Qa_008%`~H%=C2cz<nebjC}T`5&J@n$Ps^ z2g8@%Hb>QIpaN^jiUW_2Gu%u5W6k(r;q@2Oqy7E;L7mDw-@Z8&n`(Xwzp2Bz#6g(# z+}n5ic5E!Hsj(41lB{z3_U&l4PuuggCxF|PPu3i0W_OUy_n9yF=;E#H>+2RieO^{3 z_WQS`^^TJn`m#$JL{7LjHa8!YeERRxDN&!;GkhO24BWO&H#3{|(8ex&ole7V&wp{X zr5`VOpH59vUs=0tYF?h+zX$wc`TKQmK3~nSr{C_w*Y)Wu4j8XXT=mH8r=9ze#b@2! z-TCEg4r~suI8ip~{Lyalm))PApO4>LRVpN%7V+}hHL=wCr&Gi4)%|`eskK1u@cR#T zyBU8ur!~dwuan)**OdQ{>-8SBEVZ56WI|3Y6<ISsH$Q*=oH<7lBJP<bxGaAY@BU+3 z#G7~TqGn7kKYZ0Hm_e@n{=>g#&-(U#SGG^K@6>Pk5tyoezwvAN{aSHpetEkm;emAl z<`dpq>=8WjP^2qP;3@l6n{9`B-+!?C#qg;7Th|*+d)`O$Z7Pc@DkP%SC2q+*wr)80 zu2stQ=fYI;eUBB6H})QuHtqW4d|EE_=e+j@Jsro7$!OT~K3ZJ#-{RPZX};Vyct5)R z)DB<QlYDYb*1@Z#@*AWd^?sVMZ_ZSO&pB_-&NjcuYp`zf&$f!iHtYPKt?Ci5pOnte z$LAnCd&0+#c2)@nqjxFFo-tv(^WGgczGL?GonZfy9cHcPTb`|aRVZ@ct?0dravu#C z+U58T6zWLs7gMaOIXm5ytz-VNj-OYh6zb}jRvb+fnZH-b>5qw?*dz6eu^sbWzTME` zUG(F|nb+6l6!*p3zMiIb<a+3;>m^P#>x-5}%@DBP@x0(J^W-JX;lhQiPJdL+2|iMv zXuHj;^~XV5qxRc@;oTZX`0t%Or6qt62aSz3mm4Y833Udq2<ec&<L$IZz`jCV_>uZV zi&n4JAOH5Y{0{o)vU;ktg53G#DgQTU$62?g-QvB)_(+jY<yHLmo6|WGKmOTpQo!fR zgQkFE<}T;&{XEawu=wxM{R|&pDE|Kad*><BOR}aFtBRA850`xDP=B+DT}JAK{N^tm z?K%SNLQij<RLc>cm-VsVwCYIlOO8EG2~M9wzFKfSSm~_CdGwXdqn%S&=k-e;pY$<X zlJjH4eW6WKPkBEUM<^ef^Ge*?@W|x%0_qV=C4bgUNbNoNNTsbpmv_q2-K(Wqm!A@J zk_0PVm7#LPxyrv%sV=N0{kid}|99{Im30xg@6OP>+(uA;U%x_iPH4p`;g7`+toInm zJ+gi3xZV6-Me;oHSkIsKzc<?--rsfqIAdd=-0^Sb`#$pSm%C%Zwqlxuh{37F{2#X3 z6h{PDx!A1ZO1dWT__o9R@AvEFUw?FtkxOH~Dpa}ACjAI|ki&$&YmY(}e1H0EV}{hU z+*cV9AvfzkO`dPC>Hz!t<{uvp^Dj19zuR!fhC9E#{Q}h93BJgSwoyIs{@W-0FYI5s zDso=uan5=AKI`FzUosyXen(eKUunmw_2JR6w*9foy^pl$eLD8^G-sB=Wbydhciz0- z#(JmzlUAJm8viD)1BL&-Ellrt{#Wj~K>XuhpC+sS+|&OjN8t3&_b)OUr@lBJ7yd2n z`F8h@|0Wk#Jiqz(H}{@Xw)roMvhF@qd?#*MF1G0J{&Vkjp8Qn@4dDHMIsf0w@cqB8 z*1rTVK!_=Oc!+h!`Fm+wU2ODPlz3tm)XT`fUf~zoxH+2P<E!RtiZ*KL(-co{&F-E& zImGou=dHK5ipsbZ{9Z<tGw<8|jNSgn!TkE)w_Q%C8Sh`hAjAIsU}w#<<jxA7-|>u( z1o^kU4m~B>$&|i++rgIT-G`+=8=w9WTho7J_S&;I?z$c+tEsuONczDdKEKcUvAb0E zsoUlqs4Y;6={#+0vB-bgM(Gz9c6n<it8hI~S@YIeMnYoRU551syO-!1E#AtMo}T>n zURtYV%#*(_{p)9$JV>z-X#kH+7FOm~<~%mpUphVLScZtj_ut?7%zGbHtlpt__(_4t zoO$zZ-`KG7hMR5U_AbyGtwkxIbqJuv3+MZCW7c)H1#eoimnpsfn~Bw`nKO=mV_IJN zitVNLhpXF^ZQ0sDOECPv%Mv~;di`E-edmua{BKm}S}WP{3#Q%g((9;yyY+g@2^$fC zN5y+)26fE0y>EDl`(vfSu4L_&3dMgvd(Lg{l=^7M&D!##ui%XGZUOMhgKvzkA1eiR z6>GQrkm1kwy^<o>R=(%OT8(|ia>W`B9paBfk3PS_E^_qwf#-6!6plQvsL<{T7tufR zz2Ue_7ie79^`qrCMnyYzyYCm+6zz^5jt<<j2-G9Dc^1$jpnpWW>-<K3j*pffcD9>w ze6*Ci*Y!yBDECL(2ZrrREftD!fi-=#4jtzk&)aTEEICsD>m^e?*Cw{mgn5B~(&w*z z74`Xb#V-AQ><-J~k92hWf3f)JQt$Ks-`#u5RW;?qIqR)l2OsvX+8rP&T55iS$04)1 zulTXTy=vjx;p?|$id3;)xO3F>1h-+}?wg+vvd3!)^sRnXk$rcU*}<&SyUT6j?Yvgs ze0aV{wdIHT{hH71_J0;W{35>p$I;j8_y2owaq;f*_eF>64rRaC$gY1SZPtU&i{<~G zFrJyYE8v&){hxjTX~!=m1Wgx;dLqmH(dNvX+6@+~3VqnxlP*7&NnJF-YUeKb%oQu# zk8EF@ICq-S*^G|w%vY=5UoCCV=csc1evz*#X+^@u`Stru4)0@=<+l|ujXECv`r1}b zH@BLzeDkFqF&1u+a8N(w@aOye`uVr-|GxMA!_^CI>ks5jEb)-%Ve_~w`*FoC_alq9 z)Cl%Jel^*DUrTa;oOPkYBI`#MN7h?>n89{jQMu&LX_h~S3tunR>aS2q7PH>g{GnZg zu`R$mK&|Z2`-_X8i;8-GZnx6fbl|ejuSea_-44~gai7^}c%ox&M)I@{{$qi`%dRxv zIVo&i(elbMG{;#<B$YX9W4=M}d%uGgjY+<h@(~-nCwwwV&^<V_A@`&0l2zSGyuT%? zJFc^^%?>>ww}pvofzp!Wb$=oaTAU^bralUPb4KLj0Yk}N1zCaP>KwOEMzVd~|L^O1 z<|F_AJhyjWlcnrZV8*a&k;5F-A3ZDjL?5;sxTMUebx0tIxyRk6ZqsK@m4pWV=9#k9 z32fb4-~8b`xk32Z)9xRu6mBijo#(zd{jtOY!4BtEmu+^vymEiGT^8s+EE-wS^5FWT zlRDoXHw#sy+!E}Yq9c5DV^CXT*sQr(65JVViHT|(eTuq_*<{vv2`g9YFMQqgqi~YO zJgI3~&huv7nxgGs(_X_oQ}pR?HkGBbIjp7G0*rnK89YC{FGS>2O)UGzds=P(Lt{nu zZ|X06;k0_~^I(~I>!)mMik-sT`F_zg<Bg4nKD*ikaAYtw*`=u~<?dp$7q#TmYyQ1- zquB$#z=_-+T$!Zh0t9Dt#~&>B`@KL+oBen0qZ0!CywVjrdQ)^JPdV<FldPb4s=IR| zJEu|aqi}_J?ki=BZ0d9zm`y4>*p6!z8NN#FPj^UhFA`i}a^R4swdjXpeT|m*+DxA3 zoOyBw!U7Y79_u{b$J(=H!tv)^+~FT~9ra(VIPb#4`IZ+q%N;XbwRC!|#Obn`n{{UP zZkl%BQ2Ldm+cKTLGE;n{Kcw5Onsw?k^S4(&&EFUDIfcef$=zsoETL7l|H$^AD=vkx z#EN9jkdu5{u)^NBQq9|`_@j%ZLkw&7r;G02#j2|3v0b!P&(f*b-dSod$8hRT7q9mG zhc*X$|L)_Gda2&0vozIRiZ4XM=1+%d{*m9Dkut}gX!1vWxqj(fuJz0_o7F7xnhlS& z|DSU&k@MJ#M~V4AIMga@m$vNS=c$z3kg;F(fbNG__0t(0&v%?y$<w{y<JJBh%giqN zv)p!R+1USay*z8PVZ)x!&0I=b9@*G2*UUS~+T5!@r|!!+Em1R%gll5EGcsik-<Y%Z z+g9;t!IbYE+s&fNS6yZoa<TD@niI4=vUIlS#}-|;zXx4<YgxNz-cU=CsFGgXy`0IX zq5te&gQDj*+3HhgioL%a^=^w)CUaSu)X~omzOZj_&3e+*U+BT&cO^nZUSZx&n@0zw zmTb45E&2RlfQyY_L)A>dgVS9<9t=FYOXBR$%$RHMw6{(%b4uy|p_KSi+&*0FN8jZO zKMX9sc6^_%*VDN#|AWiH>^>oj(6=ko-=!_dpJ*!kq<ou$4VUKIMUL{x{7?M;a67({ z%FonJ>#x||ClwQ~D&ws`r|8!{3)B5fANPcumK2@Rxkv11wVN{U^1GI=42sfSmzaIJ zbv)=6hoScoV=ePfNr#=*GJO2EVzWli^Al(M-rb%kX3(n2Uc8BCSx(PJMU{@V9cgjV z%0@Y6$JRJG|In`ABzE)Zj!PQ%)R+BTTChfZZY^i}(nz=NN8ZtaA;+B37O!2I67-|7 z(OCMZ#=ZEQ?b-b<+xCl{@{~?{K2>^G=kjcswLi0Ek3^?$xVi0;p41V;J)h)x%-%FE zUAw|*kN=tG6=mw48H?JAAF*Z6=33umnqFGq^Z0&3(XslcF?*IeZY<lrRCTk)yzqdX z_tTPleoJtIob;LV&6AM2Op*7(pUckIEUx(CT@qk@@mL%GmnMyQ#cDPdp2gN-k`5mQ zzCKiB=lP#4aP4Ew%!X}`TPCxedD<?cefGw~{;ZtIky|b-tLnP)A^n=qnZ+jgN5VA^ zZ@au%EGC#&nz@EwQ)!;EZTef=Ym!_SI$bLx=l(sCmvHWrWViUMNU7w4oDXN1eKp=L zGHJeEbmO?qj@$>Dxvrv*bPZ3R5&U>ic5+*Oed<<;qqkK$&(0K4f7)4b?9HBO-c7|( z^FLbHxs~M=Yc1o*`*Z50)V%Z$_oTHqi+r3mL-^ND<$2FfSnza}+p!!}P%e4*<)g*- z+j1>w|H7ASk2&hmzVu@n&wuT25Be`I)$jf8`lGmp`^Lu0K}pTx*Vg#F`FPo-@vn}t z#mN=2)35eEIM(?ne11oTdQ~CQ&J&IrY2ST=9J(KMZ@pmZ%3HZRWM$}^iXX`j%W`Gn z|8DU&)W3ZB^uKrKSLt<`I5OAHtlNEq>woqItJm9otNgSAZ4O2MFA&!3u|0TB;os5q zb=z8QA1#`}y@&5n?VE$`&w1^{^J}(z=KPbwXk8ZNmGeQ*(^~q2X0y@E8|m?d&o2J< zPqzJa#rkN-11{EMjy3!BK8R=LnytC7l@=DI)$v|7OY4HR!jb1YSVFrxo`2zMD);O8 zF`+UoV_o&SZGK{kackN^BY*3ssujOs=DcU3sl>mqL16ylhjTMT_Uq}q)!sAL)3WPP zyFyw~D%VG+J&S(G{BBtE<4J-|&%tIzySqEDsF~}25$69^*Z;>Nu;xQeq?X~2AOGG4 zO78x;!fob9_mA51qNLc$_fCzfIkzqF;)#13TYg>TZTs=4_MoX%DyN~f-VNE1u1jH` zMfS7xdu=nm{hVvwHyyDPrl)s>r>OQcRA`)xcD26ucz@U&w@n46tyd#w-HD2e6p?Sw zONpL-WSP(_-FtiD1B?E2JokNiclsaM%FyyVg72>{U*jL`-MMjXiRTkB*R^MjcphE+ z{c}s=2M71=xP9M#9(GGzwB>4t`Dtm<-ByJkSn4w$#qBVbdh~Y|<6Xh~$+xd7$sG>T zcdn3~&v&Ku+P071zq<8R*zmdpl)2Yz_;w)b)mpy|WvY@YFY5j^7A`tI^+ouW42dJZ zpNDlY*iC$qp1)&4@P<Rxe_L-&oSS;9(tN(^#-m$nWA{9_idZq1Tl9hYe4!l=uP;)) z(RqY<Z8rbsKU})9FAYjW@)d0sSLj(k78gHUXV(!DVo@+BUG?tqZP7F9ZU)-jY}xhU zxxBfv8`q1E>7qZU$Q;_~qgg0l;=TI%`VN6NE@fLz%bjZ7`o_EFMd#Ix=8w)d{Y~oM z+T*Cc<yk~#+|q>3v#-_(Sw70$>!xIPDD-ak>En}^*!(<j+2`9IU9%6O#rpGZeX9`3 z%##;8w6)v1&#iP5e?!Io0zL6|M)S%8x07GL+4Sb%HU-DOt+#$^*nIjlu~05VXTHXE z^%EQCKP{fIae^?rO1Y7Ezp%uCj!FK#!W#QD?rrV8RcY{9@|QyI`o5(%KfaXiNct<e zeeI4*g741QX*^;+5+H16oz?#%yfeA)v6hL9`^rhzcV6szbtXf$N7yt*SK)=?8y=gT zI&Y`tFv+Vv%@V#QnWKJ+Um!k<Vba6q`4yJ}ZY6tLD|&C9ck&sFI&aRcUF(F5AN|$Z zeR18Zb5FA^zTMcvrSsgHBRALR&@BI5x7fD*loQemJ>ReEo#}k^m1)^4ftuV|i~{-o z?Vlrz);wPAyXH6h1<9Dt1{)@4$o;WVtE~9(IXiw?uZG;U9=(t2<@0w;7B;nG*}S+_ zUF?W&z}&Oe(FN_cw(GLbJEq=sj5a^GphMp)Yt{`Tou!Wgz9qPp9y<MbuHSZ}To=w? zLY61u|0Wf@F<YYkwZ+gU!MP$}%GZcbcaK$9wJe?(AHUEdXEtM4$VT(1!@dWS)YoMB zHT<X&Uy<ZyGrdD`-lLeSbG4rr{AF%=zO9ByeBP3$+rIQ}J*sadzotoYjcos$zj010 zlKwJueBb>1U`$Ox*g0lt*|{D1bIa11>J1_|+UEZ_?rdnm<5fP1+r_^7>t*hq*UU#M z4(GHeuv)0B+0c0Mj6wFARK@-u)43jXTit%j`~KY`i>2ae5^paF#&H$vnSFTZWfZ5h zYtxN`8k%iBt8%p)F2(=Zx+?mY;0bn?Inx{)&1R-4EztND_qo*Y-MUvBkNQPio#Rkk z^VN2_l2M1`$AgPv>rNfI7BRmjwEV-Y?xVk_Gu_&i?2;ug<MtPChLU|dv?9{d=e+!J zQSkgtPPRyn^#vMHBJv9JCcokNSn=q*MMpa$fBx_6u8QvW2Qq4M-WI+4&R#6~sPanT zqGi)d-xfR7th8X<FY(jpR_d3mbl09`%>T`tZ2o3kmbJ0m{Cj1WO6qo(z5k|p*)J+q zHR7|`xA|&gQE0zz*&(Z?8^5g)ls~`for77zS@Ed_vWEQ?=dS)ZDS7USa<{Hg&T`G8 zmNQcX&#z7_>k$>t`u<UH+gp{n*VnAMFI;)7cE5>e-KLwOUrN~;mIm4!XWM^a&(W7< zkIrZn@I=4erx!iX&fqq`2hVW{8@8*3o=%UOLIu}k$4fm7b4fp+d~6j<v)>h#>AV-> z4)^*NOzm=JJX^TOF7r{rzq?{(+l|)l3Od4`8nt)Bk!3Lz%Z~2bvMai3^UdN3^QL?1 zCVzZ$!Tgk$#<ych{jQG|2#1-fYpnfJv;Bf(Qr{y%@nW~xEIkFG-y5Fw94z#`y1#1n zY3|35cb@-o_nf!H_38IgZocnzQ1-i0!SX>w^f<%9%;OT<FBa}hWYpPadH#gOIpuro z*Il%pztg><<+_Jg(dL}4;r^nE1d-0%djIaoLzg+^?CsVpo~YBPYRvE?Tq;<m+N;}D z&wkHVwcV*QA|J0De09j|A4j?M<yAt*t@SwCHDyH~dvxaRI9cT+`e?1s>ky4bX12w= z^W+tF_pT4UJ1Laq>nEP($!|8ye8_EOX{R%R&EUX#r<%-u-7+WbvwhPaZQ=jA{v$*9 znU3w-XG=X&j=6ewTL1RahZ~Py6aIER;pe{mW}WMcpNIcBa#H4Z1m}(Tn7<WopI%<Z z$u?s}qWG2%ErG`Q9v?nDicNj9(&w=KyX|l4ewM!3GOsuH-qA$O?$gJkXKuS!Uih`F zeywRm%;o3|$2s{<R~J3JlV5r@^7=i0$>aSM`MR~otHWP)FxUSSy&7JTyY=6_sXCKm zkLtgEU(MlV954LTBl69(H>>x>|ICy8B7Z-BC$EX{DaYL#mfuLWoWc6~w6W^!WMQLy zTW*=hAML3)mvsB?(~Ij~@g1%R<~{i8eJ79FwZGvP?kr2~dVOoNhW!cCrDco199Fn@ zpYM)r#Lejm<yBv<URt=gBJRwa)3-jJepw!MMlDO?{q-GlH?AvLTKvvp{)+E9B~Lnz z|7kmW)g&qGOlPHjO@ZgOD+w(>|7{IBY?>u;<naR61?eBZ{y1I`W%_G(Rn^9tj3dS| zYuRV*vUt7pp(*#r>#<pBkrR8qa~G^zcKrGE0A=}kT<3cKJQmUJ?U(sD=g5nHGhP%F z<OCWmPrbHpfvB?MBW{Tj`<xIbaaK2n8u8Cl%0*Zoxz}*FX?X{;vUNXle|f~vt;5hH zrlbELckpe6Bj!sJr@d_bA#<He{L%7b**pi^1?H=6nr-IQA^zyA*94j04RM^8rnJsn zCjO|{W{>Dm?Jn_0#;#?T(>P&`5P|!2m$r5ObMM~0PonI$>zY?3=Qy#hi`iN8^V8=C zd%j)UTm607-3Ko;+Md5pb#`ZsyK(E*-Meew{&~)se{avvN8S4WzHQ&1>m|Ij-<Q!s zkljRPSH-U{FF)PbSHC}beb6@vk&49P&$qT_>-N1p-Y>7eoAKY=f|{VKdo>D*nEdbU zDqZbrzJs4nM{NJEtLu}Pr@hHs#W1Jh*jLpX_21iP&+fh(D|`E-c0qx|@@*E|{Lk%Z zaI~)!tXi0IsddiW>B(pEF7irz`1|9yeIAzx#0BeOtVI4kI5*e&^kHdR<(Knpiy!;@ z$KSa3Z}Qr;j~_o4J8rh=&W^(5o4f{oXJSq+nO$Gh6gewDc3(|Z)va~Xf3C*=6@8Xv z_wUE!8#7d^UuiRZKiFw)ZT*7T`^aMRm|ZoJ&wq5c^OshruRQSaqvf1--3JHS-}2== zIdtPg{kCoAa&vXReV;6%m}&Ao>CeN5;p<~8cW?T(q}1HP#^%nA8#@Xf9@_u+_WrBs zT|vhdLk21fo*Ex{Y+v*9^yYILZ`_NUw^n)G`8WK%zuuJ>XN%Ns+5P+K*|XEl%x?K! ztPqotkxAGPU&dV07QNkQ%4_+5i68&IPrsp8(mZ!=v9xsj?K?+!Mb`d2*Yo@L@AdnB zy^`eFcE9#}?3{b4-ww_^RlfiC-7`|H&kjTuNXl&Ax;6FiAEU1A{CTSrxN3!h9=x7C z`}+F$=N)(dHV5wl?E~F5r$uDK%76z~*XqhVS-bpY)4b+v;~kQZA06$!WTwmdz$hlO z{r8!L@lJc*9_5&Dmfex}*p}kw=PrhVPAr-4d-=kI#fulei_q6)Tyx%YMf|@{)1RN8 zU;pq;bKZxC?efpA?AmuC?hR*ytDn=~)BFE$tF64rdqMt!c2U+`_1{uQ_+5HGcC#`X zu1Sn~mH+QqenG<Hw8TH%r%ykQUL>U+!th-*XI|~Ss@H3;$Jft2m^uBmnD92&(CuLi z!T}D9d;0Af<{i*$+;?%;0TrWZ?jJp8?7Qai*gEF)ZC8PrU7xZ`PwO;(l$G9boWb3~ zx=myL%*Em6$A9>}U#$M4Z{kLgn@aaS%l=b-v@vnY@z(a9zpIu7Ha;*=d$jSs#{IvK zmMrOuXFOjX;eAAWxBDO7%*4cP9mjKc{7yZH>PqS`KlM4_x_UnAgYtT#JUH*oo8Ge~ zN2H%#^e+lkh(2;S@!z9ncbi(vJEE&%etRu?`|0ih<$2AuFGW|mL~CtcEz+>~@8$%# zk1VdQ)sH^9Zj*kb`fGPb|9$gK8_HRkj(m^X$K~VH$neqg#+_Rpiu<;foSFeSgGBm3 z66pMb<$6JZf3C=NEUHtq<1+WjZ2_Hw!nPv5L*C)amoAY<mp|WR5aa&H++kHZ(P>oS z&<>ueiTv_*dy1Z(x_D7An@^zr^)+3Yw~M8havcwQaBpvQ!IzUKIkmra*xTCft@~?b zb?k=O%6%6_cT|2>tKse6oYr6Qh4)LBb@{uVyel4}dTy)Izhup`sob=2BV+uePjVmc zv|V>M_Y&<}d*I$ZxthIu_xhfaepI;S{kwOM)O#3{Z!h`f7S0gYw*FyZ&^>|vxW;{r z^Dp?jnP)BG+U#oc<@WvipcSY)7v9KS@=w&!)MCEzDdCUDzV{?==V<9a&GO@xhW`=i z`xl)bZQ2^1UF5cB`Jem$-rk?|=27+fzv{h*dOn4(kK0@Dkm+&xM_b<KU(=Tc%GEO1 zHh!$WSJPfGQ~91o{l7nzJA!N8zpwCIqY@-{_W^ist#EN%{j*7*UNEybeXHRYtS=}y z@Or|Mg?1mc8-mYeUteci@!^1;YN@@9!NFE;(H#-8^`BD}MR(NvG}2T5#;xPy|9H*x zh3o7*H9+g4`{nJw2~>z3Wfs_;e}CJ%rV@#FMZaqP|GxkK+xGo)gS#(??cjNAxX%28 z!f}qf6W`C6`y@up?u8yhZCcmfzu#`>@BJE<*83?@lI_{y!-xCsKKSutMsehi1rAf@ z&rEv3{DO0)>8bYA0{J;7@;>l<{G!2^zkBbRWc|QzhN2F4_HNzEdaZn+O<QGKj)Y~E zjk-i|`^@XD8g-xFB!B1HF2KT)5PxZ}o9>lvMQ)knw|zK1t3Iksp1IEM=!1FJ%n~jf zo5<<5eVK8-&g<_f`%8<bY@Ex)@vyK$IVpR(>`nomMbZ!EJ-()@@%RZBXx8gJcf69^ zp7%{{CvPh=uV83@Rn~Ltzy(3xPfjXa1uOE7XSDopYx9_;Y<x@ez{0AR0al@kHP*6= zPr3SR-~Dv{;kw-q6}1FYe5NbU`YyXwT5d^A2-gk4y$7C#TbS<Pke<5MXxTm{3+cnl z>#Dpf|NpBkX<qI>f7^-GIvX_`URK;mzj{b3CeqdX0_#q(OGl@%`n70J=X<*2?$cjB zIk~ep+pe8{^U>c!#nbebZ`&T1#=X4Z#O%o;#d+NC7YIJu{EFGBChT3#Z3)GFYl|YE z3P0Lhq%N&|B>lyeXTCy@W@k@J<WsbBUe5JV(rRnv<dz@LW~I(>?l^y8rBh9tU+z5> z#eF-|B%cX9GA>yqFn?k2Y;(_!{B@CSmMuSc=4y=^lP39WhTO+~Ion;;-}U~zb-jDu z?)RH+{e3T%t|;N2De!TA-B07SZ7+CUMEyuuoZ%UI+?jis>F)KnCcD}6JzAu^gZ-Y4 zm599}cd_eL&flNXUKcHM`J+C+rs(CRrK`i&*L^t1{zLrsUB~{S0*~#}l>2*v73JE+ zehJ4M;Fsz0*Nh8)(X&{ja<}!Pz2EO8zh9*KBP(^$?6of{erWQaQtz#>(6*TN@L>79 zO7`FOzg{T+c=7qXy?J{Pe-)qEn%{-YvPS&*+w7FooNa7G4E~;+tbU`pKH7ZQ4c%QL zQ}ga|3i9(;-F>rRjlLS+i3JmWRqCo96P5dXr<wP4)Sr{=!Z(g3Cdm4C>@R%G*48ez z>HBO}Im7)0A!hAOUys<@sc=3zn)KFTkNmCQrutJasX5oYJlJ0_Z{Fd;4&Eh=lPlg7 zO7A;T$IbIF{I=)OzbE<&<|$it>HcaCHJJ7JZ?ovb=8lG)8yvGEr@TGxf8%7vq3EQK ztaVR0Pn}Q~`=~HaZ$VF-(&q&~Pw=_A#g#DxJM3!C++$sFMm+Xd;UWK<3(LG?Y~Ix7 z$8`T#bhgy0;r;d(iq{TY{k!(`n&el3HX%!|d|Af-ucpBxK!m@5E1E0m@*VjZt7RMi zJ<fLAu41yt>Vvnmwd5o3gXw}Y{y!IL{^^SA<Gp;n&rSa8Z9na4bDOt(z3I!^Y;ii# z>$TpGEY1Lt9>z!kuLsG0+axERjy@FZdhO6h=G>PRSwXLMidsK*-1G9Jr{${ym$NSG zeh_?YIxlAOdk=^5fQa{fTGJElg^KIgSbt6arO>jxXU&y8+a6uH_g(CDc&QbGQ1psM z-fz#h{$0EBb?q-6f&4lhHqSS%|0=%Zy8lWrI$me`@#e}3yY1HmWkS{nh{YX$A8T{N z`(B0Md)BX?cRmZLKjXkHH?6Ir{@t<9UmWz8xNz=Esk-<`t?ztF7eD)iww)8^+Ujp$ z={&hf;meDoiKSdK1wOv;&)8b)V?OV~jE^>3IKteV)ppNc@sZI~MR(WYQ>kk>A|FUe zB?lH~PKXQ54160j`*jI}pTJEGrrTNHwp+>R`%Y$mv{2V7^kt~kyjJnY>c@mbADb*L z{dX!Z{IcMRzVr_UZFg7p-H+bAetl1&;=M<Y5}c+@*6KOE<6-8ztsgqRuhHCfM=k4v zu;<y}c7<@kkI%xng)?US-*7<m?;8F8Q>Pg#KDwDwSM!Fa^H0tU`<q5A#SeHgvU!jE zQ+l*IM(o6)ir&V}bLadtDN71Gp4}sGQ#7;qEZ>2R_sc(7{asrcev;v1OKGTw+>tnu zRTXQOYAoRW^G3*&zlK}yVL6|r>EC;|n)jy6;rUqSbT}$$xi{mZzlkqfzb(&~Nw9tN z_e0#A%O(sPr4_3KR;F@RP5P?H%@eqiKXC1nN~L{U;%CMGSZz5)$vH@_)b&WTPMFlu z@SSTcOw;|2wCxW{fBy2>!L4!Hw_-Lkf6!{0`{(ML{I&g`uL!<hzu4#t-x3YiJ-tt} zOOr1&oC~-w_(r<SEbQ|8Y+Xr{gDD-)3-gTM{5aJ-r-sMncwIN6ZkPJ&$~`w55;Z=u z@9e+m<6GaAe&l0v=h^q-)k5z1)|FqTT_|EJ&rUR)kiES3k+-xf`^Cs99DT?97VEM{ z{WjfUa>`n>J8+M@?v2(6h5Tb1xF7#J#r5}4AG`U+h&LMrYqwta%3XJp@r2InC!xot zPg?C7?kW3m9{-$d-n1v(PE-3>8cSX%hV|XOANct|`cJpDv+D96?v~r^(^+x2s^C_% zi;YdAiH+1wU(P>uZPoYcWq2wW#MPg@d6v=lL}vo??%ExfkJsJ_mN7mf)L*A~@B5XY z&OQA(C%))CuF?LR*I`~Cx|8Sk%lO|c%OiEB$%mysZam+b8!tXPIIH+9U&Eg4Uj1*| z%h+o!b(oh&-|jYk<GPUP{>N+sgBv@}9lo=S{k6;wo96GAnN9!RJJ-DT$t;PFY}c%M zS5|eTeLZZdTlZ8~rqqY)Qb_E>%)pT8I>D|VOLO!}-KX~d*%(s#o<)0Yk>t1aFBqQb zt7z}tT;|&C)t!5tG3xvFt4->?Kdfq3dd~_v8*RO4?)}|2;_dTAI@af}3%VAlkapzy z#`~8(+~Vnzk6Wa(ckQCU#?4+jN6w$R8`>-S$oLK0O$E7q4{Nj|;(z@}YCHFOy{A)6 zeUw_vB!T%GKCkjQ&-qbuSNa+?&X38OvZc08HCNtcrq2<$@3;L-5$DI5mRn+rTYi-7 za-Hkl(SOS}SyKH-|I(5xUpYPo?p{8((5c4yuF+}LBk9jBl${lPbo-@Psh*-;*7u&& zIRf_6E(Km!KH~m%UfD6uk8ev(>r5AzKhycPse4EM^5`o&TYjv#Ydo#c=}&~0du+de z{MPDQlIlmcU)J3m<5ZKzmwR1Cao^m$z~@4b7MGomI5tup_?ZWEG}SS&f4#RNB*Xn1 z-){EbyCvSM6t%&&Vdu`ux3{*6h27m%%6<32lP61D<5D}l7%c?X#aMm$@k1hdd;a~t zQ+AS<oj~V@?)dcV>}=gnaxyXs@0;2Aqn?CLTOnd$W7DGj{_gJUhgR*~Yy0Hx{rmY7 z!y^|3F@Rfst&tXMch~$hVi26#X|!x56TiG&OYq11%RL_a@AGqV66P%j+t_Gb{%(P^ zP35O0t)cGj?l!wo&6u;=(L)|&z(l4Gs($BhpS`p}>D<)^_ual~6^3v<$l-A=-5n`q z)>3RbYiIANwZ6R{J>r$*=D)ta{_y(UyLT(NUVb#Cu87s(Ak)6bH{Myytb2M&l&x^a zzS(;MjTTH~vfw}bgy$DSm6Q1Qg)(!l6@Lnw{HZraz&U9LPha!z2QGeRY@BVj-LU^4 zy^F)|##c`##+J7Ql6DJ>)e^1CjJ|Mw<FDDaZQG;(2RA21pDmZNJ1*_|F!wL}j0c%^ zo{Fu(fep#Vi%q2G%~zIN$Es{Fu{~~**W?s+kpo|^mVJI7`k2x0+eO|bxlvpRO-t|J q6pdMbxMKb^j!j~E+<J%q)XOPxU3l7c)|G*Qfx*+&&t;ucLK6VkWidGb diff --git a/doc/style.css b/doc/style.css index 297e2cbf..e6da5a40 100644 --- a/doc/style.css +++ b/doc/style.css @@ -5,6 +5,7 @@ body margin-left: 100px; margin-right: 100px; font-family: arial, sans-serif; + font-size: small; } p.banner @@ -51,7 +52,7 @@ code /* font-weight: bold; */ background-color: white; color: #8B0000; - font-size: large; +/* font-size: large; */ } pre.example diff --git a/install-sh b/install-sh deleted file mode 100644 index 4d4a9519..00000000 --- a/install-sh +++ /dev/null @@ -1,323 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2005-05-14.22 - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -chmodcmd="$chmodprog 0755" -chowncmd= -chgrpcmd= -stripcmd= -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src= -dst= -dir_arg= -dstarg= -no_target_directory= - -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG -" - -while test -n "$1"; do - case $1 in - -c) shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - --help) echo "$usage"; exit $?;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t) dstarg=$2 - shift - shift - continue;; - - -T) no_target_directory=true - shift - continue;; - - --version) echo "$0 $scriptversion"; exit $?;; - - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; - esac -done - -if test -z "$1"; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src ;; - esac - - if test -n "$dir_arg"; then - dst=$src - src= - - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi - else - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dstarg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 - exit 1 - fi - dst=$dst/`basename "$src"` - fi - fi - - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` - - # Make sure that the destination directory exists. - - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - shift - IFS=$oIFS - - pathcomp= - - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 - shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit - fi - pathcomp=$pathcomp/ - done - fi - - if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - - else - dstfile=`basename "$dst"` - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 - - # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit 1 - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit 1; } -done - -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit 0 -} - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/ltmain.sh b/ltmain.sh deleted file mode 100644 index 8fc56db8..00000000 --- a/ltmain.sh +++ /dev/null @@ -1,6871 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 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. - -basename="s,^.*/,,g" - -# 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 $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION="1.5.22 Debian 1.5.22-2" -TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes. -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit $EXIT_SUCCESS -fi - -default_mode= -help="Try \`$progname --help' for more information." -magic="%%%MAGIC variable%%%" -mkdir="mkdir" -mv="mv -f" -rm="rm -f" - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -# 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 - SP2NL='tr \040 \012' - NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - SP2NL='tr \100 \n' - NL2SP='tr \r\n \100\100' - ;; -esac - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -# We save the old values to restore during execute mode. -if test "${LC_ALL+set}" = set; then - save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL -fi -if test "${LANG+set}" = set; then - save_LANG="$LANG"; LANG=C; export LANG -fi - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - $echo "$modename: not configured to build any kind of library" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $mkdir "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } - fi - - $echo "X$my_tmpdir" | $Xsed -} - - -# 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. -func_win32_libid () -{ - 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 - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` - 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_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 () -{ - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - 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 "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # 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. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # 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 - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - 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 - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xdir="$my_gentop/$my_xlib" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - 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 have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -disable_libs=no - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2005 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" - ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac - -# 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= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # 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= - - 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) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$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,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$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. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qlibobj="\"$qlibobj\"" ;; - esac - test "X$libobj" != "X$qlibobj" \ - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; 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 "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - 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 "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; 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." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T <<EOF -# $libobj - a libtool object file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# Name of the PIC object. -EOF - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - if test ! -d "${xdir}$objdir"; then - $show "$mkdir ${xdir}$objdir" - $run $mkdir ${xdir}$objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then - exit $exit_status - fi - fi - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - command="$command -o $lobj" - fi - - $run $rm "$lobj" "$output_obj" - - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit $EXIT_FAILURE - fi - - if test "$need_locks" = warn && - 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." - - $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 - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object='$objdir/$objname' - -EOF - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - else - # No PIC object so indicate it doesn't exist in the libtool - # object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object=none - -EOF - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$obj" "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit $EXIT_FAILURE - fi - - if test "$need_locks" = warn && - 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." - - $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 - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object='$objname' - -EOF - else - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object=none - -EOF - fi - - $run $mv "${libobj}T" "${libobj}" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" - fi - - exit $EXIT_SUCCESS - ;; - - # libtool link mode - link | relink) - modename="$modename: link" - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which 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 which 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= - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - notinst_path= # paths that contain not-installed libtool libraries - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - fi - 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 - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$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 "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; 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" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework|darwin_framework_skip) - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - 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 - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - 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 - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework|-arch|-isysroot) - case " $CC " in - *" ${arg} ${1} "* | *" ${arg} ${1} "*) - prev=darwin_framework_skip ;; - *) compiler_flags="$compiler_flags $arg" - prev=darwin_framework ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - 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*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - notinst_path="$notinst_path $dir" - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # 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$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -pg pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ - -t[45]*|-txscale*|@*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # 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 - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$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 "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; 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" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - 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. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'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\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then - exit $exit_status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - 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 test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; 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 test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$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 - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; 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 "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; 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 "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # 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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $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 used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # 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 - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; 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. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$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 - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && 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 - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; 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 "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { test "$prefer_static_libs" = no || 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 - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$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 "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - 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 "$use_static_libs" = built && test "$installed" = yes ; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; 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 "$linkmode" = lib && - test "$hardcode_into_libs" = yes; 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 "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; 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*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - 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 "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; 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 module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | - $EGREP ": [^:]* bundle" >/dev/null ; 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 - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; 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 "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; 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 - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; 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 "$linkmode" = prog; 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 "$hardcode_direct" != unsupported; 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 "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; 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 can not 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 "$module" = yes; 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 "$build_old_libs" = no; 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 "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - 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 "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # 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 "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_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 "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # 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 - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; 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 - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # 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="$2" - number_minor="$3" - number_revision="$4" - # - # 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 - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - 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]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - 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]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - 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]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - 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 - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - 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 "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - 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 "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; 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) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e "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 - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; 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 "*) ;; - *) dlfiles="$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 "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-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 "$build_libtool_need_lc" = "yes"; then - deplibs="$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. - $rm conftest.c - cat > conftest.c <<EOF - int main() { return 0; } -EOF - $rm conftest - $LTCC $LTCFLAGS -o conftest conftest.c $deplibs - if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` - for i in $deplibs; do - name=`expr $i : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" -ne "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $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 I believe you do not have" - $echo "*** because a test_compile did reveal that the linker did not use it for" - $echo "*** its dynamic dependency list that programs get resolved with at runtime." - fi - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else - # Error occurred in the first compile. Let's try to salvage - # the situation: Compile a separate program for each library. - for i in $deplibs; do - name=`expr $i : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - $rm conftest - $LTCC $LTCFLAGS -o conftest conftest.c $i - # Did it work? - if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $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 a test_compile did reveal that the linker did not use this one" - $echo "*** as a dynamic dependency that programs can get resolved with at runtime." - fi - fi - else - droppeddeps=yes - $echo - $echo "*** Warning! Library $i is needed by this library but I was not able to" - $echo "*** make it link in! You will probably need to install it or some" - $echo "*** library that it depends on before this library will be fully" - $echo "*** functional. Installing it before continuing would be even better." - fi - else - newdeplibs="$newdeplibs $i" - fi - done - fi - ;; - file_magic*) - set dummy $deplibs_check_method - file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$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 - # 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 "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$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 - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$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 - newdeplibs="$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 - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; 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 - fi - ;; - 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 is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; 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 "$build_old_libs" = no; 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 "$allow_undefined" = no; 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 "$build_old_libs" = no; 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 - - - # 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 "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$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 "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$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" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$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 "$mode" != relink && 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 - realname="$2" - shift; 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 - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "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"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && 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 "X$skipped_export" != "X:" && - len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # 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 - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - 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~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "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" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - 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\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && 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 - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(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 "$mode" = relink; then - $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 - $show "${rm}r $gentop" - $run ${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 - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run 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 "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $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= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${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" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - 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 "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$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 "*) ;; - *) finalize_rpath="$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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$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 "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - else - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # 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 >/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/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - 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*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - else - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - fi - ;; - * ) - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - esac - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - 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 "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit_status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $exit_status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - 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 - rpath="$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 - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; 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 "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "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}\" || 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 - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - output_name=`basename $output` - output_path=`dirname $output` - 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 - - cat > $cwrappersource <<EOF - -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname - Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP - - The $output program cannot be directly executed until all the libtool - libraries that it depends on are installed. - - This wrapper executable should never be moved out of the build directory. - If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "/bin/sh $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. -*/ -EOF - cat >> $cwrappersource<<"EOF" -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <malloc.h> -#include <stdarg.h> -#include <assert.h> -#include <string.h> -#include <ctype.h> -#include <sys/stat.h> - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#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 -# 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 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -/* -DDEBUG is fairly common in CFLAGS. */ -#undef DEBUG -#if defined DEBUGWRAPPER -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -const char * base_name (const char *name); -char * find_executable(const char *wrapper); -int check_executable(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - DEBUG("(main) argv[0] : %s\n",argv[0]); - DEBUG("(main) program_name : %s\n",program_name); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <<EOF - newargz[0] = (char *) xstrdup("$SHELL"); -EOF - - cat >> $cwrappersource <<"EOF" - newargz[1] = find_executable(argv[0]); - if (newargz[1] == NULL) - lt_fatal("Couldn't find %s", argv[0]); - DEBUG("(main) found exe at : %s\n",newargz[1]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; - - for (i=0; i<argc+1; i++) - { - DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); - ; - } - -EOF - - case $host_os in - mingw*) - cat >> $cwrappersource <<EOF - execv("$SHELL",(char const **)newargz); -EOF - ;; - *) - cat >> $cwrappersource <<EOF - execv("$SHELL",newargz); -EOF - ;; - esac - - cat >> $cwrappersource <<"EOF" - return 127; -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char)name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable(const char * path) -{ - struct stat st; - - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) && - ( - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ -#if defined (S_IXOTH) - ((st.st_mode & S_IXOTH) == S_IXOTH) || -#endif -#if defined (S_IXGRP) - ((st.st_mode & S_IXGRP) == S_IXGRP) || -#endif - ((st.st_mode & S_IXUSR) == S_IXUSR)) - ) - return 1; - else - return 0; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise */ -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]; - int tmp_len; - char* concat_name; - - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - - 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 = 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 ("getcwd failed"); - 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 ("getcwd failed"); - 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 * -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 (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# 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. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# 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 variable: - 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 - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - 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 >> $output "\ - - # 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 $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit $EXIT_FAILURE - 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 $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - # 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 - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then - exit $exit_status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_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 - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$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= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "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}\" || 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 - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; 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) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# 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' - -# Libraries that this one depends upon. -dependency_libs='$dependency_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 "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - 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. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$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 "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. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - 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 - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run 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 - if test "$linkname" != "$realname"; then - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$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 - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run 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 - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - 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 - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo 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. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo 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. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir=`func_mktempdir` - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "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) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "X----------------------------------------------------------------------" | $Xsed - $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" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - 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 - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # 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 - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - 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) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - 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 test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --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 - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -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. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to <bug-libtool@gnu.org>." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [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: $modename [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 - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -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: $modename [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: $modename [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: $modename [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 rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [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 - -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 - -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 - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -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: $modename [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." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# The TAGs below are defined such that we never get into a situation -# in which 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 -disable_libs=shared -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -disable_libs=static -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/m4/ax_cxx_toolset.m4 b/m4/ax_cxx_toolset.m4 deleted file mode 100644 index fd2582d5..00000000 --- a/m4/ax_cxx_toolset.m4 +++ /dev/null @@ -1,163 +0,0 @@ -dnl $Id: ax_cxx_toolset.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -dnl @synopsis AX_CXX_TOOLSET([]) -dnl -dnl The AC_CXX_TOOLSET_INFO macro runs simple tests to detect C++ compiler. -dnl It sets four variables with compiler vendor name, abbreviation, -dnl toolset (based on toolset names used in Boost library) -dnl and compiler command. -dnl -dnl Currently, only GNU C/C++ and Microsoft Visual C++ are supported. -dnl -dnl This macro does not take any parameters. -dnl -dnl This macro sets following variables: -dnl -dnl CXX_TOOLSET_VENDOR -dnl CXX_TOOLSET_FULLNAME -dnl CXX_TOOLSET_NAME -dnl CXX_TOOLSET_COMMAND -dnl -dnl No AC_SUBST are called. -dnl -dnl The idea of this macro is based on AX_COMPILER_VENDOR macro -dnl developed and copyrighted by Ludovic Courtès <ludo@chbouib.org> -dnl Source: http://autoconf-archive.cryp.to/ac_cxx_compiler_vendor.html -dnl -dnl @category CXX -dnl @author Mateusz Loskot <mateusz@loskot.net> -dnl @version 2006-08-30 -dnl @license AllPermissive - -dnl -dnl Generic compiler detector -dnl -AC_DEFUN([AX_C_IFDEF], -[ - AC_COMPILE_IFELSE( - [#ifndef $1 - #error "Compiler definition macro $1 is undefined!" - #endif], [$2], [$3]) -]) - -dnl -dnl Visual C++ compiler detector -dnl -dnl TODO - mloskot: It has not been tested with Autoconf + Visual C++. -dnl I even don't know if it's feasible and well-working to use -dnl Autoconf with Visual C++ toolset. -dnl If anyone knows how to test it, please give me a note. Thanks! -dnl -AC_DEFUN([AX_C_IFDEF_MSVC], -[ - AC_COMPILE_IFELSE( - [ - #ifndef $1 - #error "Compiler definition macro $1 is undefined!" - #endif - ], - [ - AC_COMPILE_IFELSE([#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4 - #error "Macro test _MSC_VER < 1300 is false, it is not VC++ 6.0!" - #endif - ], - [ - ac_cxx_msvc_toolset=vc60 - $2 - ], - [ - AC_COMPILE_IFELSE([#if _MSC_VER <= 1300 // 1300 == VC++ 7.0 - #error "Macro test _MSC_VER <= 1300 is false, it is not VC++ 7.0!" - #endif - ], - [ - dnl Visual C++ 6.0 detected - ac_cxx_msvc_toolset=vc70 - $2 - ], - [ - AC_COMPILE_IFELSE([#if _MSC_VER <= 1300 // 1300 == VC++ 7.0 - #error "Macro test _MSC_VER <= 1300 is false, it is not VC++ 7.0!" - #endif - ], - [ - dnl Visual C++ 7.0 detected - ac_cxx_msvc_toolset=vc70 - $2 - ], - [ - AC_COMPILE_IFELSE([#if _MSC_VER < 1310 // 1310 == VC++ 7.1 - #error "Macro test _MSC_VER < 1310 is false, it is not VC++ 7.1!" - #endif - ], - [ - dnl Visual C++ 7.1 detected - ac_cxx_msvc_toolset=vc71 - $2 - ], - [ - AC_COMPILE_IFELSE([#if _MSC_VER <= 1400 // 1400 == VC++ 8.0 - #error "Macro test _MSC_VER < 1400 is false, it is not VC++ 8.0!" - #endif - ], - [ - dnl Visual C++ 8.0 detected - ac_cxx_msvc_toolset=vc80 - $2 - ], - [$3]) - ]) - ]) - ]) - ]) - ], - [$3]) -]) - -AC_DEFUN([AX_CXX_TOOLSET], -[ - AC_REQUIRE([AC_PROG_CXX]) - AC_REQUIRE([AC_PROG_CXXCPP]) - - AC_CACHE_CHECK([the C++ compiler vendor], - [ac_cxx_toolset_vendor], - [ - AC_LANG_PUSH([C++]) - - dnl GNU C/C++ - AX_C_IFDEF([__GNUG__], - [ - ac_cxx_toolset_vendor="Free Software Foundation" - ac_cxx_toolset_fullname="GNU C/C++ Compiler" - ac_cxx_toolset_name="gcc" - ac_cxx_toolset_cmd="g++" - ], - [ - dnl Microsoft Visual C++ - AX_C_IFDEF_MSVC([_MSC_VER], - [ - ac_cxx_toolset_vendor="Microsoft" - ac_cxx_toolset_fullname="Visual C++" - ac_cxx_toolset_name=$ac_cxx_msvc_toolset - ac_cxx_toolset_cmd="cl" - ], - [ - ac_cxx_toolset_vendor=unknown - ac_cxx_toolset_fullname=unknown - ac_cxx_toolset_name=unknown - ac_cxx_toolset_cmd=unknown - ]) - ]) - - AC_LANG_POP() - ]) - - dnl - dnl Output variables - dnl - CXX_TOOLSET_VENDOR=$ac_cxx_toolset_vendor - CXX_TOOLSET_FULLNAME=$ac_cxx_toolset_fullname - CXX_TOOLSET_NAME=$ac_cxx_toolset_name - CXX_TOOLSET_COMMAND=$ac_cxx_toolset_cmd - -]) diff --git a/m4/ax_firebird.m4 b/m4/ax_firebird.m4 deleted file mode 100644 index 00ecb48a..00000000 --- a/m4/ax_firebird.m4 +++ /dev/null @@ -1,165 +0,0 @@ -dnl $Id: ax_firebird.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -dnl @synopsis AX_LIB_FIREBIRD([MINIMUM-VERSION]) -dnl -dnl Test for the Firebird client library of a particular version (or newer) -dnl -dnl This macro takes only one optional argument, required version -dnl of Firebird library. If required version is not -dnl passed, then 1.5.0 is used in test of existance of Firebird -dnl client library. -dnl -dnl For more information about Firebird API versioning check: -dnl API Identifies Client Version -dnl http://www.firebirdsql.org/rlsnotes20/rnfbtwo-apiods.html -dnl -dnl If no intallation prefix to the installed Firebird library is given -dnl the macro searches under /usr, /usr/local, and /opt. -dnl -dnl This macro calls: -dnl -dnl AC_SUBST(FIREBIRD_CFLAGS) -dnl AC_SUBST(FIREBIRD_LDFLAGS) -dnl AC_SUBST(FIREBIRD_VERSION) -dnl -dnl And sets: -dnl -dnl HAVE_FIREBIRD -dnl -dnl @category InstalledPackages -dnl @category Cxx -dnl @author Mateusz Loskot <mateusz@loskot.net> -dnl @version $Date: 2006/08/30 14:28:55 $ -dnl @license AllPermissive -dnl -dnl $Id: ax_firebird.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -AC_DEFUN([AX_LIB_FIREBIRD], -[ - AC_ARG_WITH([firebird], - AC_HELP_STRING( - [--with-firebird=@<:@ARG@:>@], - [use Firebird client library @<:@default=yes@:>@, optionally specify the prefix for firebird library] - ), - [ - if test "$withval" = "no"; then - WANT_FIREBIRD="no" - elif test "$withval" = "yes"; then - WANT_FIREBIRD="yes" - ac_firebird_path="" - else - WANT_FIREBIRD="yes" - ac_firebird_path="$withval" - fi - ], - [WANT_FIREBIRD="yes"] - ) - - FIREBIRD_CFLAGS="" - FIREBIRD_LDFLAGS="" - FIREBIRD_VERSION="" - - if test "x$WANT_FIREBIRD" = "xyes"; then - - ac_firebird_header="ibase.h" - - firebird_version_req=ifelse([$1], [], [3.0.0], [$1]) - firebird_version_req_shorten=`expr $firebird_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - firebird_version_req_major=`expr $firebird_version_req : '\([[0-9]]*\)'` - firebird_version_req_minor=`expr $firebird_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - firebird_version_req_micro=`expr $firebird_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$firebird_version_req_micro" = "x" ; then - firebird_version_req_micro="0" - fi - - dnl FB_API_VER represents the version of Firebird as follows: - dnl - Any version of Interbase, or Firebird 1.0.x: 10 - dnl - Firebird 1.5.x: 15 - dnl - Firebird 2.0.x: 20 - - firebird_version_req_number=`expr $firebird_version_req_major \+ $firebird_version_req_minor` - - AC_MSG_CHECKING([for Firebird client library >= $firebird_version_req]) - - if test "$ac_firebird_path" != ""; then - ac_firebird_ldflags="-L$ac_firebird_path/lib" - ac_firebird_cppflags="-I$ac_firebird_path/include" - else - for ac_firebird_path_tmp in /usr /usr/local /opt ; do - if test -f "$ac_firebird_path_tmp/include/$ac_firebird_header" \ - && test -r "$ac_firebird_path_tmp/include/$ac_firebird_header"; then - ac_firebird_path=$ac_firebird_path_tmp - ac_firebird_cppflags="-I$ac_firebird_path_tmp/include" - ac_firebird_ldflags="-L$ac_firebird_path_tmp/lib" - break; - fi - done - fi - - ac_firebird_header_path="$ac_firebird_path/include/$ac_firebird_header" - - if test ! -f "$ac_firebird_header_path"; then - AC_MSG_RESULT([no]) - success="no" - else - - ac_firebird_ldflags="$ac_firebird_ldflags -lfbclient -lpthread" - - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $ac_firebird_cppflags" - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE( - [ - AC_LANG_PROGRAM([[@%:@include <ibase.h>]], - [[ -#if (FB_API_VER >= $firebird_version_req_number) -// Everything is okay -#else -# error Firebird version is too old -#endif - ]] - ) - ], - [ - AC_MSG_RESULT([yes]) - success="yes" - ], - [ - AC_MSG_RESULT([not found]) - succees="no" - ] - ) - AC_LANG_POP([C++]) - - CPPFLAGS="$saved_CPPFLAGS" - - if test "$success" = "yes"; then - - FIREBIRD_CFLAGS="$ac_firebird_cppflags" - FIREBIRD_LDFLAGS="$ac_firebird_ldflags" - - dnl Retrieve Firebird release version - - ac_firebird_version=`cat $ac_firebird_header_path | \ - grep '#define.*FB_API_VER.*' | \ - sed -e 's/.* //'` - - if test -n "$ac_firebird_version"; then - ac_firebird_version_major=`expr $ac_firebird_version \/ 10` - ac_firebird_version_minor=`expr $ac_firebird_version \% 10` - - FIREBIRD_VERSION="$ac_firebird_version_major.$ac_firebird_version_minor.x" - else - AC_MSG_WARN([Could not find FB_API_VER macro in $ac_firebird_header to get Firebird version.]) - fi - - AC_SUBST(FIREBIRD_CFLAGS) - AC_SUBST(FIREBIRD_LDFLAGS) - AC_SUBST(FIREBIRD_VERSION) - AC_DEFINE(HAVE_FIREBIRD) - fi - fi - fi -]) - diff --git a/m4/ax_mysql.m4 b/m4/ax_mysql.m4 deleted file mode 100644 index 7dedd8cc..00000000 --- a/m4/ax_mysql.m4 +++ /dev/null @@ -1,143 +0,0 @@ -dnl $Id: ax_mysql.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -dnl @synopsis AX_LIB_MYSQL([MINIMUM-VERSION]) -dnl -dnl This macro provides tests of availability of MySQL client library -dnl of particular version or newer. -dnl -dnl AX_LIB_MYSQL macro takes only one argument which is optional. If there is no -dnl required version passed, then macro does not run version test. -dnl -dnl The --with-mysql option takes one of three possible values: -dnl no - do not check for MySQL client library -dnl yes - do check for MySQL library in standard locations -dnl (mysql_config should be in the PATH) -dnl path - complete path to mysql_config utility, use this option -dnl if mysql_config can't be found in the PATH -dnl -dnl This macro calls: -dnl -dnl AC_SUBST(MYSQL_CFLAGS) -dnl AC_SUBST(MYSQL_LDFLAGS) -dnl AC_SUBST(MYSQL_VERSION) -dnl -dnl And sets: -dnl -dnl HAVE_MYSQL -dnl -dnl @category InstalledPackages -dnl @category Cxx -dnl @author Mateusz Loskot <mateusz@loskot.net> -dnl @version $Date: 2006/08/30 14:28:55 $ -dnl @license AllPermissive -dnl -dnl $Id: ax_mysql.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -AC_DEFUN([AX_LIB_MYSQL], -[ - AC_ARG_WITH([mysql], - AC_HELP_STRING([--with-mysql=@<:@ARG@:>@], - [use MySQL client library @<:@default=yes@:>@, optionally specify path to mysql_config] - ), - [ - if test "$withval" = "no"; then - want_mysql="no" - elif test "$withval" = "yes"; then - want_mysql="yes" - else - want_mysql="yes" - MYSQL_CONFIG="$withval" - fi - ], - [want_mysql="yes"] - ) - - MYSQL_CFLAGS="" - MYSQL_LDFLAGS="" - MYSQL_VERSION="" - - dnl - dnl Check MySQL libraries (libpq) - dnl - - if test "$want_mysql" = "yes"; then - - if test -z "$MYSQL_CONFIG" -o test; then - AC_PATH_PROG([MYSQL_CONFIG], [mysql_config], []) - fi - - dnl MYSQL_CONFIG is provided but it does not point to executable file - if test ! -x "$MYSQL_CONFIG"; then - AC_MSG_ERROR([$MYSQL_CONFIG does not exist or it is not an exectuable file]) - MYSQL_CONFIG="no" - found_mysql="no" - fi - - if test "$MYSQL_CONFIG" != "no"; then - AC_MSG_CHECKING([for MySQL libraries]) - - MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`" - MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`" - - MYSQL_VERSION=`$MYSQL_CONFIG --version` - - AC_DEFINE([HAVE_MYSQL], [1], - [Define to 1 if MySQL libraries are available]) - - found_mysql="yes" - AC_MSG_RESULT([yes]) - else - found_mysql="no" - AC_MSG_RESULT([no]) - fi - fi - - dnl - dnl Check if required version of MySQL is available - dnl - - - mysql_version_req=ifelse([$1], [], [], [$1]) - - if test "$found_mysql" = "yes" -a -n "$mysql_version_req"; then - - AC_MSG_CHECKING([if MySQL version is >= $mysql_version_req]) - - dnl Decompose required version string of MySQL - dnl and calculate its number representation - mysql_version_req_major=`expr $mysql_version_req : '\([[0-9]]*\)'` - mysql_version_req_minor=`expr $mysql_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - mysql_version_req_micro=`expr $mysql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$mysql_version_req_micro" = "x"; then - mysql_version_req_micro="0" - fi - - mysql_version_req_number=`expr $mysql_version_req_major \* 1000000 \ - \+ $mysql_version_req_minor \* 1000 \ - \+ $mysql_version_req_micro` - - dnl Decompose version string of installed MySQL - dnl and calculate its number representation - mysql_version_major=`expr $MYSQL_VERSION : '\([[0-9]]*\)'` - mysql_version_minor=`expr $MYSQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'` - mysql_version_micro=`expr $MYSQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$mysql_version_micro" = "x"; then - mysql_version_micro="0" - fi - - mysql_version_number=`expr $mysql_version_major \* 1000000 \ - \+ $mysql_version_minor \* 1000 \ - \+ $mysql_version_micro` - - mysql_version_check=`expr $mysql_version_number \>\= $mysql_version_req_number` - if test "$mysql_version_check" = "1"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - - AC_SUBST([MYSQL_VERSION]) - AC_SUBST([MYSQL_CFLAGS]) - AC_SUBST([MYSQL_LDFLAGS]) -]) diff --git a/m4/ax_oracle_oci.m4 b/m4/ax_oracle_oci.m4 deleted file mode 100644 index 52a74ca2..00000000 --- a/m4/ax_oracle_oci.m4 +++ /dev/null @@ -1,267 +0,0 @@ -dnl $Id: ax_oracle_oci.m4,v 1.8 2006/12/02 08:46:36 mloskot Exp $ -dnl -dnl @synopsis AX_LIB_ORACLE_OCI([MINIMUM-VERSION]) -dnl -dnl This macro provides tests of availability of Oracle OCI API -dnl of particular version or newer. -dnl This macros checks for Oracle OCI headers and libraries -dnl and defines compilation flags -dnl -dnl Macro supports following options and their values: -dnl 1) Single-option usage: -dnl --with-oracle - path to ORACLE_HOME directory -dnl 2) Two-options usage (both options are required): -dnl --with-oracle-include - path to directory with OCI headers -dnl --with-oracle-lib - path to directory with OCI libraries -dnl -dnl NOTE: These options described above does not take yes|no values. -dnl If 'yes' value is passed, then WARNING message will be displayed, -dnl 'no' value, as well as the --without-oracle* variations will cause -dnl the macro won't check enything. -dnl -dnl This macro calls: -dnl -dnl AC_SUBST(ORACLE_OCI_CFLAGS) -dnl AC_SUBST(ORACLE_OCI_LDFLAGS) -dnl AC_SUBST(ORACLE_OCI_VERSION) -dnl -dnl And sets: -dnl -dnl HAVE_ORACLE -dnl -dnl @category InstalledPackages -dnl @category Cxx -dnl @author Mateusz Loskot <mateusz@loskot.net> -dnl @version $Date: 2006/12/02 08:46:36 $ -dnl @license AllPermissive -dnl -dnl $Id: ax_oracle_oci.m4,v 1.8 2006/12/02 08:46:36 mloskot Exp $ -dnl -AC_DEFUN([AX_LIB_ORACLE_OCI], -[ - AC_ARG_WITH([oracle], - AC_HELP_STRING([--with-oracle=@<:@DIR@:>@], - [use Oracle OCI API from given path to Oracle home directory] - ), - [ - if test "$withval" = "yes"; then - if test -n "$ORACLE_HOME"; then - oracle_home_dir="$ORACLE_HOME" - else - oracle_home_dir="" - fi - fi - ], - [ - if test -n "$ORACLE_HOME"; then - oracle_home_dir="$ORACLE_HOME" - else - oracle_home_dir="" - fi - ] - ) - - AC_ARG_WITH([oracle-include], - AC_HELP_STRING([--with-oracle-include=@<:@DIR@:>@], - [use Oracle OCI API headers from given path] - ), - [oracle_home_include_dir="$withval"], - [oracle_home_include_dir=""] - ) - AC_ARG_WITH([oracle-lib], - AC_HELP_STRING([--with-oracle-lib=@<:@DIR@:>@], - [use Oracle OCI API libraries from given path] - ), - [oracle_home_lib_dir="$withval"], - [oracle_home_lib_dir=""] - ) - - ORACLE_OCI_CFLAGS="" - ORACLE_OCI_LDFLAGS="" - ORACLE_OCI_VERSION="" - - dnl - dnl Collect include/lib paths - dnl - want_oracle_but_no_path="no" - - if test -n "$oracle_home_dir"; then - - if test "$oracle_home_dir" != "no" -a "$oracle_home_dir" != "yes"; then - dnl ORACLE_HOME path provided - - dnl Primary path to OCI headers, available in Oracle>=10 - oracle_include_dir="$oracle_home_dir/rdbms/public" - - dnl Secondary path to OCI headers used by older versions - oracle_include_dir2="$oracle_home_dir/rdbms/demo" - - dnl Library path - oracle_lib_dir="$oracle_home_dir/lib" - elif test "$oracle_home_dir" = "yes"; then - want_oracle_but_no_path="yes" - fi - - elif test -n "$oracle_home_include_dir" -o -n "$oracle_home_lib_dir"; then - - if test "$oracle_home_include_dir" != "no" -a "$oracle_home_include_dir" != "yes"; then - oracle_include_dir="$oracle_home_include_dir" - elif test "$oracle_home_include_dir" = "yes"; then - want_oracle_but_no_path="yes" - fi - - if test "$oracle_home_lib_dir" != "no" -a "$oracle_home_lib_dir" != "yes"; then - oracle_lib_dir="$oracle_home_lib_dir" - elif test "$oracle_home_lib_dir" = "yes"; then - want_oracle_but_no_path="yes" - fi - fi - - if test "$want_oracle_but_no_path" = "yes"; then - AC_MSG_WARN([Oracle support is requested but no Oracle paths have been provided. \ -Please, locate Oracle directories using --with-oracle or \ ---with-oracle-include and --with-oracle-lib options.]) - fi - - dnl - dnl Check OCI files - dnl - if test -n "$oracle_include_dir" -a -n "$oracle_lib_dir"; then - - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$oracle_include_dir" - - dnl Additional path for older Oracle installations - if test -n "$oracle_include_dir2"; then - CPPFLAGS="$CPPFLAGS -I$oracle_include_dir2" - fi - - saved_LDFLAGS="$LDFLAGS" - oci_ldflags="-L$oracle_lib_dir -lclntsh -lnnz10" - LDFLAGS="$LDFLAGS $oci_ldflags" - - dnl - dnl Check OCI headers - dnl - AC_MSG_CHECKING([for Oracle OCI headers in $oracle_include_dir]) - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[@%:@include <oci.h>]], - [[ -#if defined(OCI_MAJOR_VERSION) -#if OCI_MAJOR_VERSION == 10 && OCI_MINOR_VERSION == 2 -// Oracle 10.2 detected -#endif -#elif defined(OCI_V7_SYNTAX) -// OK, older Oracle detected -// TODO - mloskot: find better macro to check for older versions; -#else -# error Oracle oci.h header not found -#endif - ]] - )], - [ - ORACLE_OCI_CFLAGS="-I$oracle_include_dir" - - if test -n "$oracle_include_dir2"; then - ORACLE_OCI_CFLAGS="$ORACLE_OCI_CFLAGS -I$oracle_include_dir2" - fi - - oci_header_found="yes" - AC_MSG_RESULT([yes]) - ], - [ - oci_header_found="no" - AC_MSG_RESULT([not found]) - ] - ) - AC_LANG_POP([C++]) - - dnl - dnl Check OCI libraries - dnl - if test "$oci_header_found" = "yes"; then - - AC_MSG_CHECKING([for Oracle OCI libraries in $oracle_lib_dir]) - - AC_LANG_PUSH(C++) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[@%:@include <oci.h>]], - [[ -OCIEnv* envh = 0; -OCIEnvCreate(&envh, OCI_DEFAULT, 0, 0, 0, 0, 0, 0); -if (envh) OCIHandleFree(envh, OCI_HTYPE_ENV); - ]] - )], - [ - ORACLE_OCI_LDFLAGS="$oci_ldflags" - oci_lib_found="yes" - AC_MSG_RESULT([yes]) - ], - [ - oci_lib_found="no" - AC_MSG_RESULT([not found]) - ] - ) - AC_LANG_POP([C++]) - fi - - CPPFLAGS="$saved_CPPFLAGS" - LDFLAGS="$saved_LDFLAGS" - fi - - dnl - dnl Check required version of Oracle is available - dnl - oracle_version_req=ifelse([$1], [], [], [$1]) - - if test "$oci_header_found" = "yes" -a "$oci_lib_found" = "yes" -a \ - -n "$oracle_version_req"; then - - oracle_version_major=`cat $oracle_include_dir/oci.h \ - | grep '#define.*OCI_MAJOR_VERSION.*' \ - | sed -e 's/#define OCI_MAJOR_VERSION *//' \ - | sed -e 's/ *\/\*.*\*\///'` - - oracle_version_minor=`cat $oracle_include_dir/oci.h \ - | grep '#define.*OCI_MINOR_VERSION.*' \ - | sed -e 's/#define OCI_MINOR_VERSION *//' \ - | sed -e 's/ *\/\*.*\*\///'` - - AC_MSG_CHECKING([if Oracle OCI version is >= $oracle_version_req]) - - if test -n "$oracle_version_major" -a -n $"oracle_version_minor"; then - - ORACLE_OCI_VERSION="$oracle_version_major.$oracle_version_minor" - - dnl Decompose required version string of Oracle - dnl and calculate its number representation - oracle_version_req_major=`expr $oracle_version_req : '\([[0-9]]*\)'` - oracle_version_req_minor=`expr $oracle_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - - oracle_version_req_number=`expr $oracle_version_req_major \* 1000000 \ - \+ $oracle_version_req_minor \* 1000` - - dnl Calculate its number representation - oracle_version_number=`expr $oracle_version_major \* 1000000 \ - \+ $oracle_version_minor \* 1000` - - oracle_version_check=`expr $oracle_version_number \>\= $oracle_version_req_number` - if test "$oracle_version_check" = "1"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Oracle $ORACLE_OCI_VERSION found, but required version is $oracle_version_req]) - fi - else - ORACLE_OCI_VERSION="UNKNOWN" - AC_MSG_RESULT([no]) - AC_MSG_WARN([Oracle version unknown, probably OCI older than 10.2 is available]) - fi - fi - - AC_SUBST([ORACLE_OCI_VERSION]) - AC_SUBST([ORACLE_OCI_CFLAGS]) - AC_SUBST([ORACLE_OCI_LDFLAGS]) -]) diff --git a/m4/ax_postgresql.m4 b/m4/ax_postgresql.m4 deleted file mode 100644 index 6742c449..00000000 --- a/m4/ax_postgresql.m4 +++ /dev/null @@ -1,142 +0,0 @@ -dnl $Id: ax_postgresql.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -dnl @synopsis AX_LIB_POSTGRESQL([MINIMUM-VERSION]) -dnl -dnl This macro provides tests of availability of PostgreSQL 'libpq' library -dnl of particular version or newer. -dnl -dnl AX_LIB_POSTGRESQL macro takes only one argument which is optional. If there is no -dnl required version passed, then macro does not run version test. -dnl -dnl The --with-postgresql option takes one of three possible values: -dnl no - do not check for PostgreSQL client library -dnl yes - do check for PostgreSQL library in standard locations -dnl (pg_config should be in the PATH) -dnl path - complete path to pg_config utility, use this option -dnl if pg_config can't be found in the PATH -dnl -dnl This macro calls: -dnl -dnl AC_SUBST(POSTGRESQL_CFLAGS) -dnl AC_SUBST(POSTGRESQL_LDFLAGS) -dnl AC_SUBST(POSTGRESQL_VERSION) -dnl -dnl And sets: -dnl -dnl HAVE_POSTGRESQL -dnl -dnl @category InstalledPackages -dnl @category Cxx -dnl @author Mateusz Loskot <mateusz@loskot.net> -dnl @version $Date: 2006/08/30 14:28:55 $ -dnl @license AllPermissive -dnl -dnl $Id: ax_postgresql.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -AC_DEFUN([AX_LIB_POSTGRESQL], -[ - AC_ARG_WITH([postgresql], - AC_HELP_STRING([--with-postgresql=@<:@ARG@:>@], - [use PostgreSQL library @<:@default=yes@:>@, optionally specify path to pg_config] - ), - [ - if test "$withval" = "no"; then - want_postgresql="no" - elif test "$withval" = "yes"; then - want_postgresql="yes" - else - want_postgresql="yes" - PG_CONFIG="$withval" - fi - ], - [want_postgresql="yes"] - ) - - POSTGRESQL_CFLAGS="" - POSTGRESQL_LDFLAGS="" - POSTGRESQL_POSTGRESQL="" - - dnl - dnl Check PostgreSQL libraries (libpq) - dnl - - if test "$want_postgresql" = "yes"; then - - if test -z "$PG_CONFIG" -o test; then - AC_PATH_PROG([PG_CONFIG], [pg_config], []) - fi - - if test ! -x "$PG_CONFIG"; then - AC_MSG_ERROR([$PG_CONFIG does not exist or it is not an exectuable file]) - PG_CONFIG="no" - found_postgresql="no" - fi - - if test "$PG_CONFIG" != "no"; then - AC_MSG_CHECKING([for PostgreSQL libraries]) - - POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`" - POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq" - - POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'` - - AC_DEFINE([HAVE_POSTGRESQL], [1], - [Define to 1 if PostgreSQL libraries are available]) - - found_postgresql="yes" - AC_MSG_RESULT([yes]) - else - found_postgresql="no" - AC_MSG_RESULT([no]) - fi - fi - - dnl - dnl Check if required version of PostgreSQL is available - dnl - - - postgresql_version_req=ifelse([$1], [], [], [$1]) - - if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then - - AC_MSG_CHECKING([if PostgreSQL version is >= $postgresql_version_req]) - - dnl Decompose required version string of PostgreSQL - dnl and calculate its number representation - postgresql_version_req_major=`expr $postgresql_version_req : '\([[0-9]]*\)'` - postgresql_version_req_minor=`expr $postgresql_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - postgresql_version_req_micro=`expr $postgresql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$postgresql_version_req_micro" = "x"; then - postgresql_version_req_micro="0" - fi - - postgresql_version_req_number=`expr $postgresql_version_req_major \* 1000000 \ - \+ $postgresql_version_req_minor \* 1000 \ - \+ $postgresql_version_req_micro` - - dnl Decompose version string of installed PostgreSQL - dnl and calculate its number representation - postgresql_version_major=`expr $POSTGRESQL_VERSION : '\([[0-9]]*\)'` - postgresql_version_minor=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'` - postgresql_version_micro=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$postgresql_version_micro" = "x"; then - postgresql_version_micro="0" - fi - - postgresql_version_number=`expr $postgresql_version_major \* 1000000 \ - \+ $postgresql_version_minor \* 1000 \ - \+ $postgresql_version_micro` - - postgresql_version_check=`expr $postgresql_version_number \>\= $postgresql_version_req_number` - if test "$postgresql_version_check" = "1"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - - AC_SUBST([POSTGRESQL_VERSION]) - AC_SUBST([POSTGRESQL_CFLAGS]) - AC_SUBST([POSTGRESQL_LDFLAGS]) -]) diff --git a/m4/ax_sqlite3.m4 b/m4/ax_sqlite3.m4 deleted file mode 100644 index e5beebde..00000000 --- a/m4/ax_sqlite3.m4 +++ /dev/null @@ -1,148 +0,0 @@ -dnl $Id: ax_sqlite3.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -dnl @synopsis AX_LIB_SQLITE3([MINIMUM-VERSION]) -dnl -dnl Test for the SQLite 3 library of a particular version (or newer) -dnl -dnl This macro takes only one optional argument, required version -dnl of SQLite 3 library. If required version is not passed, -dnl 3.0.0 is used in the test of existance of SQLite 3. -dnl -dnl If no intallation prefix to the installed SQLite library is given -dnl the macro searches under /usr, /usr/local, and /opt. -dnl -dnl This macro calls: -dnl -dnl AC_SUBST(SQLITE3_CFLAGS) -dnl AC_SUBST(SQLITE3_LDFLAGS) -dnl AC_SUBST(SQLITE3_VERSION) -dnl -dnl And sets: -dnl -dnl HAVE_SQLITE3 -dnl -dnl @category InstalledPackages -dnl @category Cxx -dnl @author Mateusz Loskot <mateusz@loskot.net> -dnl @version $Date: 2006/08/30 14:28:55 $ -dnl @license AllPermissive -dnl -dnl $Id: ax_sqlite3.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ -dnl -AC_DEFUN([AX_LIB_SQLITE3], -[ - AC_ARG_WITH([sqlite3], - AC_HELP_STRING( - [--with-sqlite3=@<:@ARG@:>@], - [use SQLite 3 library @<:@default=yes@:>@, optionally specify the prefix for sqlite3 library] - ), - [ - if test "$withval" = "no"; then - WANT_SQLITE3="no" - elif test "$withval" = "yes"; then - WANT_SQLITE3="yes" - ac_sqlite3_path="" - else - WANT_SQLITE3="yes" - ac_sqlite3_path="$withval" - fi - ], - [WANT_SQLITE3="yes"] - ) - - SQLITE3_CFLAGS="" - SQLITE3_LDFLAGS="" - SQLITE3_VERSION="" - - if test "x$WANT_SQLITE3" = "xyes"; then - - ac_sqlite3_header="sqlite3.h" - - sqlite3_version_req=ifelse([$1], [], [3.0.0], [$1]) - sqlite3_version_req_shorten=`expr $sqlite3_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - sqlite3_version_req_major=`expr $sqlite3_version_req : '\([[0-9]]*\)'` - sqlite3_version_req_minor=`expr $sqlite3_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - sqlite3_version_req_micro=`expr $sqlite3_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$sqlite3_version_req_micro" = "x" ; then - sqlite3_version_req_micro="0" - fi - - sqlite3_version_req_number=`expr $sqlite3_version_req_major \* 1000000 \ - \+ $sqlite3_version_req_minor \* 1000 \ - \+ $sqlite3_version_req_micro` - - AC_MSG_CHECKING([for SQLite3 library >= $sqlite3_version_req]) - - if test "$ac_sqlite3_path" != ""; then - ac_sqlite3_ldflags="-L$ac_sqlite3_path/lib" - ac_sqlite3_cppflags="-I$ac_sqlite3_path/include" - else - for ac_sqlite3_path_tmp in /usr /usr/local /opt ; do - if test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" \ - && test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header"; then - ac_sqlite3_path=$ac_sqlite3_path_tmp - ac_sqlite3_ldflags="-I$ac_sqlite3_path_tmp/include" - ac_sqlite3_cppflags="-L$ac_sqlite3_path_tmp/lib" - break; - fi - done - fi - - ac_sqlite3_ldflags="$ac_sqlite3_ldflags -lsqlite3" - - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $ac_sqlite3_cppflags" - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE( - [ - AC_LANG_PROGRAM([[@%:@include <sqlite3.h>]], - [[ -#if (SQLITE_VERSION_NUMBER >= $sqlite3_version_req_number) -// Everything is okay -#else -# error SQLite version is too old -#endif - ]] - ) - ], - [ - AC_MSG_RESULT([yes]) - success="yes" - ], - [ - AC_MSG_RESULT([not found]) - succees="no" - ] - ) - AC_LANG_POP([C++]) - - CPPFLAGS="$saved_CPPFLAGS" - - if test "$success" = "yes"; then - - SQLITE3_CFLAGS="$ac_sqlite3_cppflags" - SQLITE3_LDFLAGS="$ac_sqlite3_ldflags" - - ac_sqlite3_header_path="$ac_sqlite3_path/include/$ac_sqlite3_header" - - dnl Retrieve SQLite release version - if test "x$ac_sqlite3_header_path" != "x"; then - ac_sqlite3_version=`cat $ac_sqlite3_header_path \ - | grep '#define.*SQLITE_VERSION.*\"' | sed -e 's/.* "//' \ - | sed -e 's/"//'` - if test $ac_sqlite3_version != ""; then - SQLITE3_VERSION=$ac_sqlite3_version - else - AC_MSG_WARN([Can not find SQLITE_VERSION macro in sqlite3.h header to retrieve SQLite version!]) - fi - fi - - AC_SUBST(SQLITE3_CFLAGS) - AC_SUBST(SQLITE3_LDFLAGS) - AC_SUBST(SQLITE3_VERSION) - AC_DEFINE(HAVE_SQLITE3) - fi - fi -]) - diff --git a/missing b/missing deleted file mode 100644 index 894e786e..00000000 --- a/missing +++ /dev/null @@ -1,360 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2005-06-08.21 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case "$1" in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Send bug reports to <bug-automake@gnu.org>." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). -case "$1" in - lex|yacc) - # Not GNU programs, they don't have --version. - ;; - - tar) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index cbf369c9..00000000 --- a/src/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# $Id: Makefile.am,v 1.2 2006/11/29 08:38:36 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -SUBDIRS = \ - core \ - backends - -EXTRA_DIST = - diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index f53c11d3..00000000 --- a/src/Makefile.in +++ /dev/null @@ -1,516 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.2 2006/11/29 08:38:36 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -SUBDIRS = \ - core \ - backends - -EXTRA_DIST = -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f 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-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/README b/src/README deleted file mode 100644 index 5d83faad..00000000 --- a/src/README +++ /dev/null @@ -1,39 +0,0 @@ -SOCI - The C++ Database Access Library. - -Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, - David Courtney, Pawel Aleksander Fedorynski, - Rafal Bobrowski, Mateusz Loskot - -The homepage of the SOCI library is: -http://soci.sourceforge.net/ - ---- - -You should see the following files and directories here: - -- README - This file. -- LICENSE_1_0.txt - Full text of the Boost license. -- CHANGES - The description of changes. -- contrib - Acknowledgements for contributions. - -- configure - The main auto-configuration script - this is accompanied - by other files in this directory. - -- doc/ - Documentation. - -- build/ - Additional build scripts and configuration files - for various compilation systems. - -- m4/ - Macros for autotools. - -- src/ - The source code of the library. - -- src/core/ - The main part of the SOCI library. - -- src/backends/ - Directory containing implementations and tests for - all available backends. - - -Please see the doc/structure.html file for compilation instructions. - ---- diff --git a/src/backends/Makefile.am b/src/backends/Makefile.am deleted file mode 100644 index 6d74bd8b..00000000 --- a/src/backends/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -# $Id: Makefile.am,v 1.2 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# - -SUBDIRS = \ - @EMPTY_DIRS@ \ - @FIREBIRD_DIRS@ \ - @MYSQL_DIRS@ \ - @ODBC_DIRS@ \ - @ORACLE_DIRS@ \ - @POSTGRESQL_DIRS@ \ - @SQLITE3_DIRS@ diff --git a/src/backends/Makefile.in b/src/backends/Makefile.in deleted file mode 100644 index 13c8ab55..00000000 --- a/src/backends/Makefile.in +++ /dev/null @@ -1,520 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# $Id: Makefile.am,v 1.2 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -SUBDIRS = \ - @EMPTY_DIRS@ \ - @FIREBIRD_DIRS@ \ - @MYSQL_DIRS@ \ - @ODBC_DIRS@ \ - @ORACLE_DIRS@ \ - @POSTGRESQL_DIRS@ \ - @SQLITE3_DIRS@ - -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f 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-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/empty/Makefile.am b/src/backends/empty/Makefile.am deleted file mode 100644 index 2764d1aa..00000000 --- a/src/backends/empty/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:31 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC - -noinst_LTLIBRARIES = \ - lib@SOCI_EMPTY_LIBRARY_NAME@.la - -lib@SOCI_EMPTY_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_EMPTY_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_emptydir = $(includedir)/soci/empty - -soci_empty_HEADERS = \ - soci-empty.h - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/empty/Makefile.basic b/src/backends/empty/Makefile.basic deleted file mode 100644 index 5d9eef47..00000000 --- a/src/backends/empty/Makefile.basic +++ /dev/null @@ -1,88 +0,0 @@ -# The following variable is specific to this backend and its correct -# values might depend on your environment - feel free to set it accordingly. - -EMPTYINCLUDEDIR = - -# The rest of the Makefile is indepentent of the target environment. - -COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -CXXFLAGSSO = ${CXXFLAGS} -fPIC -INCLUDEDIRS = -I../../core ${EMPTYINCLUDEDIR} - - -OBJECTS = blob.o factory.o row-id.o session.o standard-into-type.o \ - standard-use-type.o statement.o vector-into-type.o vector-use-type.o - -OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ - standard-into-type-s.o standard-use-type-s.o statement-s.o \ - vector-into-type-s.o vector-use-type-s.o - - -libsoci-empty.a : ${OBJECTS} - ar rv $@ $? - rm *.o - - -blob.o : blob.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -factory.o : factory.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -row-id.o : row-id.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -session.o : session.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -standard-into-type.o : standard-into-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -standard-use-type.o : standard-use-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -statement.o : statement.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -vector-into-type.o : vector-into-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -vector-use-type.o : vector-use-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - - -shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci-empty.so ${OBJECTSSO} - rm *.o - -blob-s.o : blob.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -factory-s.o : factory.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -row-id-s.o : row-id.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -session-s.o : session.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -standard-into-type-s.o : standard-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -standard-use-type-s.o : standard-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -statement-s.o : statement.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -vector-into-type-s.o : vector-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -vector-use-type-s.o : vector-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - - -clean : - rm -f libsoci-empty.a libsoci-empty.so diff --git a/src/backends/empty/Makefile.in b/src/backends/empty/Makefile.in deleted file mode 100644 index 0a6257d5..00000000 --- a/src/backends/empty/Makefile.in +++ /dev/null @@ -1,537 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends/empty -DIST_COMMON = $(soci_empty_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -lib@SOCI_EMPTY_LIBRARY_NAME@_la_LIBADD = -am_lib@SOCI_EMPTY_LIBRARY_NAME@_la_OBJECTS = blob.lo factory.lo \ - row-id.lo session.lo standard-into-type.lo \ - standard-use-type.lo statement.lo vector-into-type.lo \ - vector-use-type.lo -lib@SOCI_EMPTY_LIBRARY_NAME@_la_OBJECTS = \ - $(am_lib@SOCI_EMPTY_LIBRARY_NAME@_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib@SOCI_EMPTY_LIBRARY_NAME@_la_SOURCES) -DIST_SOURCES = $(lib@SOCI_EMPTY_LIBRARY_NAME@_la_SOURCES) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(soci_emptydir)" -soci_emptyHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(soci_empty_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:31 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -noinst_LTLIBRARIES = \ - lib@SOCI_EMPTY_LIBRARY_NAME@.la - -lib@SOCI_EMPTY_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_EMPTY_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_emptydir = $(includedir)/soci/empty -soci_empty_HEADERS = \ - soci-empty.h - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/empty/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/empty/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -lib@SOCI_EMPTY_LIBRARY_NAME@.la: $(lib@SOCI_EMPTY_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_EMPTY_LIBRARY_NAME@_la_DEPENDENCIES) - $(CXXLINK) $(lib@SOCI_EMPTY_LIBRARY_NAME@_la_LDFLAGS) $(lib@SOCI_EMPTY_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_EMPTY_LIBRARY_NAME@_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blob.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/row-id.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-use-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-use-type.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-soci_emptyHEADERS: $(soci_empty_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(soci_emptydir)" || $(mkdir_p) "$(DESTDIR)$(soci_emptydir)" - @list='$(soci_empty_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(soci_emptyHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(soci_emptydir)/$$f'"; \ - $(soci_emptyHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(soci_emptydir)/$$f"; \ - done - -uninstall-soci_emptyHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(soci_empty_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(soci_emptydir)/$$f'"; \ - rm -f "$(DESTDIR)$(soci_emptydir)/$$f"; \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(soci_emptydir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-soci_emptyHEADERS - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-soci_emptyHEADERS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-soci_emptyHEADERS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic maintainer-clean-local mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am uninstall-soci_emptyHEADERS - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/empty/blob.cpp b/src/backends/empty/blob.cpp deleted file mode 100644 index 9d299042..00000000 --- a/src/backends/empty/blob.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -EmptyBLOBBackEnd::EmptyBLOBBackEnd(EmptySessionBackEnd &session) - : session_(session) -{ - // ... -} - -EmptyBLOBBackEnd::~EmptyBLOBBackEnd() -{ - // ... -} - -std::size_t EmptyBLOBBackEnd::getLen() -{ - // ... - return 0; -} - -std::size_t EmptyBLOBBackEnd::read( - std::size_t /* offset */, char * /* buf */, std::size_t /* toRead */) -{ - // ... - return 0; -} - -std::size_t EmptyBLOBBackEnd::write( - std::size_t /* offset */, char const * /* buf */, - std::size_t /* toWrite */) -{ - // ... - return 0; -} - -std::size_t EmptyBLOBBackEnd::append( - char const * /* buf */, std::size_t /* toWrite */) -{ - // ... - return 0; -} - -void EmptyBLOBBackEnd::trim(std::size_t /* newLen */) -{ - // ... -} diff --git a/src/backends/empty/factory.cpp b/src/backends/empty/factory.cpp deleted file mode 100644 index c3710ba5..00000000 --- a/src/backends/empty/factory.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -// concrete factory for Empty concrete strategies -EmptySessionBackEnd * EmptyBackEndFactory::makeSession( - std::string const &connectString) const -{ - return new EmptySessionBackEnd(connectString); -} - -EmptyBackEndFactory const SOCI::empty; diff --git a/src/backends/empty/row-id.cpp b/src/backends/empty/row-id.cpp deleted file mode 100644 index 7e587355..00000000 --- a/src/backends/empty/row-id.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -EmptyRowIDBackEnd::EmptyRowIDBackEnd(EmptySessionBackEnd & /* session */) -{ - // ... -} - -EmptyRowIDBackEnd::~EmptyRowIDBackEnd() -{ - // ... -} diff --git a/src/backends/empty/session.cpp b/src/backends/empty/session.cpp deleted file mode 100644 index aeea0ce9..00000000 --- a/src/backends/empty/session.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -EmptySessionBackEnd::EmptySessionBackEnd( - std::string const & /* connectString */) -{ - // ... -} - -EmptySessionBackEnd::~EmptySessionBackEnd() -{ - cleanUp(); -} - -void EmptySessionBackEnd::begin() -{ - // ... -} - -void EmptySessionBackEnd::commit() -{ - // ... -} - -void EmptySessionBackEnd::rollback() -{ - // ... -} - -void EmptySessionBackEnd::cleanUp() -{ - // ... -} - -EmptyStatementBackEnd * EmptySessionBackEnd::makeStatementBackEnd() -{ - return new EmptyStatementBackEnd(*this); -} - -EmptyRowIDBackEnd * EmptySessionBackEnd::makeRowIDBackEnd() -{ - return new EmptyRowIDBackEnd(*this); -} - -EmptyBLOBBackEnd * EmptySessionBackEnd::makeBLOBBackEnd() -{ - return new EmptyBLOBBackEnd(*this); -} diff --git a/src/backends/empty/soci-empty.h b/src/backends/empty/soci-empty.h deleted file mode 100644 index e279f8f1..00000000 --- a/src/backends/empty/soci-empty.h +++ /dev/null @@ -1,186 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef SOCI_EMPTY_H_INCLUDED -#define SOCI_EMPTY_H_INCLUDED - -#ifdef _WIN32 -# ifdef SOCI_DLL -# ifdef SOCI_EMPTY_SOURCE -# define SOCI_EMPTY_DECL __declspec(dllexport) -# else -# define SOCI_EMPTY_DECL __declspec(dllimport) -# endif // SOCI_EMPTY_SOURCE -# endif // SOCI_DLL -#endif // _WIN32 -// -// If SOCI_EMPTY_DECL isn't defined yet define it now -#ifndef SOCI_EMPTY_DECL -# define SOCI_EMPTY_DECL -#endif - -#include "soci-backend.h" - -namespace SOCI -{ - -struct EmptyStatementBackEnd; -struct SOCI_EMPTY_DECL EmptyStandardIntoTypeBackEnd : details::StandardIntoTypeBackEnd -{ - EmptyStandardIntoTypeBackEnd(EmptyStatementBackEnd &st) - : statement_(st) {} - - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); - - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind); - - virtual void cleanUp(); - - EmptyStatementBackEnd &statement_; -}; - -struct SOCI_EMPTY_DECL EmptyVectorIntoTypeBackEnd : details::VectorIntoTypeBackEnd -{ - EmptyVectorIntoTypeBackEnd(EmptyStatementBackEnd &st) - : statement_(st) {} - - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); - - virtual void preFetch(); - virtual void postFetch(bool gotData, eIndicator *ind); - - virtual void resize(std::size_t sz); - virtual std::size_t size(); - - virtual void cleanUp(); - - EmptyStatementBackEnd &statement_; -}; - -struct SOCI_EMPTY_DECL EmptyStandardUseTypeBackEnd : details::StandardUseTypeBackEnd -{ - EmptyStandardUseTypeBackEnd(EmptyStatementBackEnd &st) - : statement_(st) {} - - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); - - virtual void preUse(eIndicator const *ind); - virtual void postUse(bool gotData, eIndicator *ind); - - virtual void cleanUp(); - - EmptyStatementBackEnd &statement_; -}; - -struct SOCI_EMPTY_DECL EmptyVectorUseTypeBackEnd : details::VectorUseTypeBackEnd -{ - EmptyVectorUseTypeBackEnd(EmptyStatementBackEnd &st) - : statement_(st) {} - - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); - - virtual void preUse(eIndicator const *ind); - - virtual std::size_t size(); - - virtual void cleanUp(); - - EmptyStatementBackEnd &statement_; -}; - -struct EmptySessionBackEnd; -struct SOCI_EMPTY_DECL EmptyStatementBackEnd : details::StatementBackEnd -{ - EmptyStatementBackEnd(EmptySessionBackEnd &session); - - virtual void alloc(); - virtual void cleanUp(); - virtual void prepare(std::string const &query, - details::eStatementType eType); - - virtual execFetchResult execute(int number); - virtual execFetchResult fetch(int number); - - virtual int getNumberOfRows(); - - virtual std::string rewriteForProcedureCall(std::string const &query); - - virtual int prepareForDescribe(); - virtual void describeColumn(int colNum, eDataType &dtype, - std::string &columnName); - - virtual EmptyStandardIntoTypeBackEnd * makeIntoTypeBackEnd(); - virtual EmptyStandardUseTypeBackEnd * makeUseTypeBackEnd(); - virtual EmptyVectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd(); - virtual EmptyVectorUseTypeBackEnd * makeVectorUseTypeBackEnd(); - - EmptySessionBackEnd &session_; -}; - -struct EmptyRowIDBackEnd : details::RowIDBackEnd -{ - EmptyRowIDBackEnd(EmptySessionBackEnd &session); - - ~EmptyRowIDBackEnd(); -}; - -struct EmptyBLOBBackEnd : details::BLOBBackEnd -{ - EmptyBLOBBackEnd(EmptySessionBackEnd &session); - - ~EmptyBLOBBackEnd(); - - virtual std::size_t getLen(); - virtual std::size_t read(std::size_t offset, char *buf, - std::size_t toRead); - virtual std::size_t write(std::size_t offset, char const *buf, - std::size_t toWrite); - virtual std::size_t append(char const *buf, std::size_t toWrite); - virtual void trim(std::size_t newLen); - - EmptySessionBackEnd &session_; -}; - -struct EmptySessionBackEnd : details::SessionBackEnd -{ - EmptySessionBackEnd(std::string const &connectString); - - ~EmptySessionBackEnd(); - - virtual void begin(); - virtual void commit(); - virtual void rollback(); - - void cleanUp(); - - virtual EmptyStatementBackEnd * makeStatementBackEnd(); - virtual EmptyRowIDBackEnd * makeRowIDBackEnd(); - virtual EmptyBLOBBackEnd * makeBLOBBackEnd(); -}; - -struct SOCI_EMPTY_DECL EmptyBackEndFactory : BackEndFactory -{ - virtual EmptySessionBackEnd * makeSession( - std::string const &connectString) const; -}; - -SOCI_EMPTY_DECL extern EmptyBackEndFactory const empty; - -} // namespace SOCI - -#endif // SOCI_EMPTY_H_INCLUDED - diff --git a/src/backends/empty/standard-into-type.cpp b/src/backends/empty/standard-into-type.cpp deleted file mode 100644 index 0941e7ff..00000000 --- a/src/backends/empty/standard-into-type.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -void EmptyStandardIntoTypeBackEnd::defineByPos( - int & /* position */, void * /* data */, eExchangeType /* type */) -{ - // ... -} - -void EmptyStandardIntoTypeBackEnd::preFetch() -{ - // ... -} - -void EmptyStandardIntoTypeBackEnd::postFetch( - bool /* gotData */, bool /* calledFromFetch */, eIndicator * /* ind */) -{ - // ... -} - -void EmptyStandardIntoTypeBackEnd::cleanUp() -{ - // ... -} diff --git a/src/backends/empty/standard-use-type.cpp b/src/backends/empty/standard-use-type.cpp deleted file mode 100644 index 9c357a93..00000000 --- a/src/backends/empty/standard-use-type.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -void EmptyStandardUseTypeBackEnd::bindByPos( - int & /* position */, void * /* data */, eExchangeType /* type */) -{ - // ... -} - -void EmptyStandardUseTypeBackEnd::bindByName( - std::string const & /* name */, void * /* data */, - eExchangeType /* type */) -{ - // ... -} - -void EmptyStandardUseTypeBackEnd::preUse(eIndicator const * /* ind */) -{ - // ... -} - -void EmptyStandardUseTypeBackEnd::postUse( - bool /* gotData */, eIndicator * /* ind */) -{ - // ... -} - -void EmptyStandardUseTypeBackEnd::cleanUp() -{ - // ... -} diff --git a/src/backends/empty/statement.cpp b/src/backends/empty/statement.cpp deleted file mode 100644 index 9c530ae6..00000000 --- a/src/backends/empty/statement.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -EmptyStatementBackEnd::EmptyStatementBackEnd(EmptySessionBackEnd &session) - : session_(session) -{ -} - -void EmptyStatementBackEnd::alloc() -{ - // ... -} - -void EmptyStatementBackEnd::cleanUp() -{ - // ... -} - -void EmptyStatementBackEnd::prepare(std::string const & /* query */, - eStatementType /* eType */) -{ - // ... -} - -StatementBackEnd::execFetchResult -EmptyStatementBackEnd::execute(int /* number */) -{ - // ... - return eSuccess; -} - -StatementBackEnd::execFetchResult -EmptyStatementBackEnd::fetch(int /* number */) -{ - // ... - return eSuccess; -} - -int EmptyStatementBackEnd::getNumberOfRows() -{ - // ... - return 1; -} - -std::string EmptyStatementBackEnd::rewriteForProcedureCall( - std::string const &query) -{ - return query; -} - -int EmptyStatementBackEnd::prepareForDescribe() -{ - // ... - return 0; -} - -void EmptyStatementBackEnd::describeColumn(int /* colNum */, - eDataType & /* type */, std::string & /* columnName */) -{ - // ... -} - -EmptyStandardIntoTypeBackEnd * EmptyStatementBackEnd::makeIntoTypeBackEnd() -{ - return new EmptyStandardIntoTypeBackEnd(*this); -} - -EmptyStandardUseTypeBackEnd * EmptyStatementBackEnd::makeUseTypeBackEnd() -{ - return new EmptyStandardUseTypeBackEnd(*this); -} - -EmptyVectorIntoTypeBackEnd * -EmptyStatementBackEnd::makeVectorIntoTypeBackEnd() -{ - return new EmptyVectorIntoTypeBackEnd(*this); -} - -EmptyVectorUseTypeBackEnd * EmptyStatementBackEnd::makeVectorUseTypeBackEnd() -{ - return new EmptyVectorUseTypeBackEnd(*this); -} diff --git a/src/backends/empty/test/Makefile.am b/src/backends/empty/test/Makefile.am deleted file mode 100644 index d63d8873..00000000 --- a/src/backends/empty/test/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/backends/empty - -noinst_PROGRAMS = \ - test_empty - -test_empty_SOURCES = \ - test-empty.cpp - -test_empty_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/empty/lib@SOCI_EMPTY_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/empty/test/Makefile.basic b/src/backends/empty/test/Makefile.basic deleted file mode 100644 index 3501524b..00000000 --- a/src/backends/empty/test/Makefile.basic +++ /dev/null @@ -1,13 +0,0 @@ -COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -INCLUDEDIRS = -I.. -I../../../core -LIBDIRS = -L.. -L../../../core -LIBS = -lsoci-core -lsoci-empty - - -test-empty : test-empty.cpp - ${COMPILER} -o $@ $? ${CXXFLAGS} ${INCLUDEDIRS} ${LIBDIRS} ${LIBS} - - -clean : - rm -f test-empty diff --git a/src/backends/empty/test/Makefile.in b/src/backends/empty/test/Makefile.in deleted file mode 100644 index 670704c1..00000000 --- a/src/backends/empty/test/Makefile.in +++ /dev/null @@ -1,483 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -noinst_PROGRAMS = test_empty$(EXEEXT) -subdir = src/backends/empty/test -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_test_empty_OBJECTS = test-empty.$(OBJEXT) -test_empty_OBJECTS = $(am_test_empty_OBJECTS) -test_empty_DEPENDENCIES = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/empty/lib@SOCI_EMPTY_LIBRARY_NAME@.la -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(test_empty_SOURCES) -DIST_SOURCES = $(test_empty_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/backends/empty - -test_empty_SOURCES = \ - test-empty.cpp - -test_empty_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/empty/lib@SOCI_EMPTY_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/empty/test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/empty/test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_empty$(EXEEXT): $(test_empty_OBJECTS) $(test_empty_DEPENDENCIES) - @rm -f test_empty$(EXEEXT) - $(CXXLINK) $(test_empty_LDFLAGS) $(test_empty_OBJECTS) $(test_empty_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-empty.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/empty/test/test-empty.cpp b/src/backends/empty/test/test-empty.cpp deleted file mode 100644 index d9090b4e..00000000 --- a/src/backends/empty/test/test-empty.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "soci.h" -#include "soci-empty.h" -#include <iostream> -#include <string> -#include <cassert> -#include <ctime> - -using namespace SOCI; - -std::string connectString; -BackEndFactory const &backEnd = empty; - - -// NOTE: -// This file is supposed to serve two purposes: -// 1. To be a starting point for implementing new tests (for new backends). -// 2. To exercise (at least some of) the syntax and try the SOCI library -// against different compilers, even in those environments where there -// is no database. SOCI uses advanced template techniques which are known -// to cause problems on different versions of popular compilers, and this -// test is handy to verify that the code is accepted by as many compilers -// as possible. -// -// Both of these purposes mean that the actual code here is meaningless -// from the database-development point of view. For new tests, you may wish -// to remove this code and keep only the general structure of this file. - -struct Person -{ - int id; - std::string firstName; - std::string lastName; -}; - -namespace SOCI -{ - template<> struct TypeConversion<Person> - { - typedef Row base_type; - static Person from(Row& /* r */) - { - Person p; - return p; - } - }; -} - -void test1() -{ - { - Session sql(backEnd, connectString); - - sql << "Do what I want."; - sql << "Do what I want " << 123 << " times."; - - std::string query = "some query"; - sql << query; - - int i = 7; - sql << "insert", use(i); - sql << "select", into(i); - - eIndicator ind = eOK; - sql << "insert", use(i, ind); - sql << "select", into(i, ind); - - std::vector<int> numbers(100); - sql << "insert", use(numbers); - sql << "select", into(numbers); - - std::vector<eIndicator> inds(100); - sql << "insert", use(numbers, inds); - sql << "select", into(numbers, inds); - - { - Statement st = (sql.prepare << "select", into(i)); - st.execute(); - st.fetch(); - } - { - Statement st = (sql.prepare << "select", into(i, ind)); - } - { - Statement st = (sql.prepare << "select", into(numbers)); - } - { - Statement st = (sql.prepare << "select", into(numbers, inds)); - } - { - Statement st = (sql.prepare << "insert", use(i)); - } - { - Statement st = (sql.prepare << "insert", use(i, ind)); - } - { - Statement st = (sql.prepare << "insert", use(numbers)); - } - { - Statement st = (sql.prepare << "insert", use(numbers, inds)); - } - { - Person p; - sql << "select person", into(p); - } - - } - - std::cout << "test 1 passed" << std::endl; -} - - -int main(int argc, char** argv) -{ - -#ifdef _MSC_VER - // Redirect errors, unrecoverable problems, and assert() failures to STDERR, - // instead of debug message window. - // This hack is required to run asser()-driven tests by Buildbot. - // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside. - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); -#endif //_MSC_VER - - if (argc == 2) - { - connectString = argv[1]; - } - else - { - std::cout << "usage: " << argv[0] - << " connectstring\n" - << "example: " << argv[0] - << " \'connect_string_for_empty_backend\'\n"; - exit(1); - } - - try - { - test1(); - // test2(); - // ... - - std::cout << "\nOK, all tests passed.\n\n"; - } - catch (std::exception const & e) - { - std::cout << e.what() << '\n'; - } -} diff --git a/src/backends/empty/vector-into-type.cpp b/src/backends/empty/vector-into-type.cpp deleted file mode 100644 index 77d1de67..00000000 --- a/src/backends/empty/vector-into-type.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -void EmptyVectorIntoTypeBackEnd::defineByPos( - int & /* position */, void * /* data */, eExchangeType /* type */) -{ - // ... -} - -void EmptyVectorIntoTypeBackEnd::preFetch() -{ - // ... -} - -void EmptyVectorIntoTypeBackEnd::postFetch( - bool /* gotData */, eIndicator * /* ind */) -{ - // ... -} - -void EmptyVectorIntoTypeBackEnd::resize(std::size_t /* sz */) -{ - // ... -} - -std::size_t EmptyVectorIntoTypeBackEnd::size() -{ - // ... - return 1; -} - -void EmptyVectorIntoTypeBackEnd::cleanUp() -{ - // ... -} diff --git a/src/backends/empty/vector-use-type.cpp b/src/backends/empty/vector-use-type.cpp deleted file mode 100644 index 210a3911..00000000 --- a/src/backends/empty/vector-use-type.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_EMPTY_SOURCE -#include "soci.h" -#include "soci-empty.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -void EmptyVectorUseTypeBackEnd::bindByPos(int & /* position */, - void * /* data */, eExchangeType /* type */) -{ - // ... -} - -void EmptyVectorUseTypeBackEnd::bindByName( - std::string const & /* name */, void * /* data */, - eExchangeType /* type */) -{ - // ... -} - -void EmptyVectorUseTypeBackEnd::preUse(eIndicator const * /* ind */) -{ - // ... -} - -std::size_t EmptyVectorUseTypeBackEnd::size() -{ - // ... - return 1; -} - -void EmptyVectorUseTypeBackEnd::cleanUp() -{ - // ... -} diff --git a/src/backends/firebird/Makefile.am b/src/backends/firebird/Makefile.am deleted file mode 100644 index 12f6b22e..00000000 --- a/src/backends/firebird/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @FIREBIRD_CFLAGS@ -AM_LDFLAGS = @FIREBIRD_LDFLAGS@ - -lib_LTLIBRARIES = \ - lib@SOCI_FIREBIRD_LIBRARY_NAME@.la - -lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - common.cpp \ - error.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_firebirddir = $(includedir)/soci/firebird - -soci_firebird_HEADERS = \ - common.h \ - error.h \ - soci-firebird.h - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/firebird/Makefile.basic b/src/backends/firebird/Makefile.basic deleted file mode 100644 index ad81a45a..00000000 --- a/src/backends/firebird/Makefile.basic +++ /dev/null @@ -1,99 +0,0 @@ -# The following variable is specific to this backend and its correct -# values might depend on your environment - feel free to set it accordingly. - -FIREBIRDINCLUDEDIR = -I/usr/local/firebird/include - -# The rest of the Makefile is indepentent of the target environment. - -COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -CXXFLAGSSO = ${CXXFLAGS} -fPIC -INCLUDEDIRS = -I../../core ${FIREBIRDINCLUDEDIR} - -OBJECTS = blob.o factory.o row-id.o session.o standard-into-type.o \ - standard-use-type.o statement.o vector-into-type.o vector-use-type.o \ - error.o common.o - -OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ - standard-into-type-s.o standard-use-type-s.o statement-s.o \ - vector-into-type-s.o vector-use-type-s.o error-s.o common-s.o - -libsoci-firebird.a : ${OBJECTS} - ar rv $@ $? - rm *.o - -soci-firebird.o : soci-firebird.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -blob.o : blob.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -error.o : error.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -common.o : common.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -factory.o : factory.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -row-id.o : row-id.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -session.o : session.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -standard-into-type.o : standard-into-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -standard-use-type.o : standard-use-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -statement.o : statement.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -vector-into-type.o : vector-into-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -vector-use-type.o : vector-use-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci-firebird.so ${OBJECTSSO} - rm *.o - -blob-s.o : blob.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -error-s.o : error.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -common-s.o : common.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -factory-s.o : factory.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -row-id-s.o : row-id.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -session-s.o : session.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -standard-into-type-s.o : standard-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -standard-use-type-s.o : standard-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -statement-s.o : statement.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -vector-into-type-s.o : vector-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -vector-use-type-s.o : vector-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -clean : - rm -f *.o libsoci-firebird.a libsoci-firebird.so diff --git a/src/backends/firebird/Makefile.in b/src/backends/firebird/Makefile.in deleted file mode 100644 index 5f9a698e..00000000 --- a/src/backends/firebird/Makefile.in +++ /dev/null @@ -1,566 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends/firebird -DIST_COMMON = $(soci_firebird_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" \ - "$(DESTDIR)$(soci_firebirddir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_LIBADD = -am_lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_OBJECTS = blob.lo common.lo \ - error.lo factory.lo row-id.lo session.lo standard-into-type.lo \ - standard-use-type.lo statement.lo vector-into-type.lo \ - vector-use-type.lo -lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_OBJECTS = \ - $(am_lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_SOURCES) -DIST_SOURCES = $(lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_SOURCES) -soci_firebirdHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(soci_firebird_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @FIREBIRD_CFLAGS@ -AM_LDFLAGS = @FIREBIRD_LDFLAGS@ -lib_LTLIBRARIES = \ - lib@SOCI_FIREBIRD_LIBRARY_NAME@.la - -lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - common.cpp \ - error.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_firebirddir = $(includedir)/soci/firebird -soci_firebird_HEADERS = \ - common.h \ - error.h \ - soci-firebird.h - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/firebird/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/firebird/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -lib@SOCI_FIREBIRD_LIBRARY_NAME@.la: $(lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_LDFLAGS) $(lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_FIREBIRD_LIBRARY_NAME@_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blob.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/row-id.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-use-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-use-type.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-soci_firebirdHEADERS: $(soci_firebird_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(soci_firebirddir)" || $(mkdir_p) "$(DESTDIR)$(soci_firebirddir)" - @list='$(soci_firebird_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(soci_firebirdHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(soci_firebirddir)/$$f'"; \ - $(soci_firebirdHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(soci_firebirddir)/$$f"; \ - done - -uninstall-soci_firebirdHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(soci_firebird_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(soci_firebirddir)/$$f'"; \ - rm -f "$(DESTDIR)$(soci_firebirddir)/$$f"; \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soci_firebirddir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-soci_firebirdHEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-soci_firebirdHEADERS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLTLIBRARIES install-man \ - install-soci_firebirdHEADERS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic maintainer-clean-local mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-soci_firebirdHEADERS - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/firebird/blob.cpp b/src/backends/firebird/blob.cpp deleted file mode 100644 index bcfc9972..00000000 --- a/src/backends/firebird/blob.cpp +++ /dev/null @@ -1,301 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" -#include "error.h" - -using namespace SOCI; -using namespace SOCI::details::Firebird; - -FirebirdBLOBBackEnd::FirebirdBLOBBackEnd(FirebirdSessionBackEnd &session) - : session_(session), from_db_(false), bhp_(0), loaded_(false), - max_seg_size_(0) -{} - -FirebirdBLOBBackEnd::~FirebirdBLOBBackEnd() -{ - cleanUp(); -} - -std::size_t FirebirdBLOBBackEnd::getLen() -{ - if (from_db_ && bhp_ == 0) - { - open(); - } - - return data_.size(); -} - -std::size_t FirebirdBLOBBackEnd::read( - std::size_t offset, char * buf, std::size_t toRead) -{ - if (from_db_ && !loaded_) - { - // this is blob fetched from database, but not loaded yet - load(); - } - - std::size_t size = data_.size(); - - if (offset > size) - { - throw SOCIError("Can't read past-the-end of BLOB data"); - } - - char * itr = buf; - std::size_t limit = size - offset < toRead ? size - offset : toRead; - std::size_t index = 0; - - while (index < limit) - { - *itr = data_[offset+index]; - ++index; - ++itr; - } - - return limit; -} - -std::size_t FirebirdBLOBBackEnd::write(std::size_t offset, char const * buf, - std::size_t toWrite) -{ - if (from_db_ && !loaded_) - { - // this is blob fetched from database, but not loaded yet - load(); - } - - std::size_t size = data_.size(); - - if (offset > size) - { - throw SOCIError("Can't write past-the-end of BLOB data"); - } - - // make sure there is enough space in buffer - if (toWrite > (size - offset)) - { - data_.resize(size + (toWrite - (size - offset))); - } - - writeBuffer(offset, buf, toWrite); - - return toWrite; -} - -std::size_t FirebirdBLOBBackEnd::append( - char const * buf, std::size_t toWrite) -{ - if (from_db_ && !loaded_) - { - // this is blob fetched from database, but not loaded yet - load(); - } - - std::size_t size = data_.size(); - data_.resize(size + toWrite); - - writeBuffer(size, buf, toWrite); - - return toWrite; -} - -void FirebirdBLOBBackEnd::trim(std::size_t newLen) -{ - if (from_db_ && !loaded_) - { - // this is blob fetched from database, but not loaded yet - load(); - } - - data_.resize(newLen); -} - -void FirebirdBLOBBackEnd::writeBuffer(std::size_t offset, - char const * buf, std::size_t toWrite) -{ - char const * itr = buf; - char const * end_itr = buf + toWrite; - - while (itr!=end_itr) - { - data_[offset++] = *itr++; - } -} - -void FirebirdBLOBBackEnd::open() -{ - if (bhp_ != 0) - { - // BLOB already opened - return; - } - - ISC_STATUS stat[20]; - - if (isc_open_blob2(stat, &session_.dbhp_, &session_.trhp_, &bhp_, - &bid_, 0, NULL)) - { - bhp_ = 0L; - throwISCError(stat); - } - - // get basic blob info - long blob_size = getBLOBInfo(); - - data_.resize(blob_size); -} - -void FirebirdBLOBBackEnd::cleanUp() -{ - from_db_ = false; - loaded_ = false; - max_seg_size_ = 0; - data_.resize(0); - - if (bhp_ != 0) - { - // close blob - ISC_STATUS stat[20]; - if (isc_close_blob(stat, &bhp_)) - { - throwISCError(stat); - } - bhp_ = 0; - } -} - -// loads blob data into internal buffer -void FirebirdBLOBBackEnd::load() -{ - if (bhp_ == 0) - { - open(); - } - - ISC_STATUS stat[20]; - unsigned short bytes; - std::vector<char>::size_type total_bytes = 0; - bool keep_reading = false; - - do - { - bytes = 0; - // next segment of data - // data_ is large-enough because we know total size of blob - isc_get_segment(stat, &bhp_, &bytes, static_cast<short>(max_seg_size_), - &data_[total_bytes]); - - total_bytes += bytes; - - if (total_bytes == data_.size()) - { - // we have all BLOB data - keep_reading = false; - } - else if (stat[1] == 0 || stat[1] == isc_segment) - { - // there is more data to read from current segment (0) - // or there is next segment (isc_segment) - keep_reading = true; - } - else if (stat[1] == isc_segstr_eof) - { - // BLOB is shorter then we expected ??? - keep_reading = false; - } - else - { - // an error has occured - throwISCError(stat); - } - } - while (keep_reading); - - loaded_ = true; -} - -// this method saves BLOB content to database -// (a new BLOB will be created at this point) -// BLOB will be closed after save. -void FirebirdBLOBBackEnd::save() -{ - // close old blob if necessary - ISC_STATUS stat[20]; - if (bhp_ != 0) - { - if (isc_close_blob(stat, &bhp_)) - { - throwISCError(stat); - } - bhp_ = 0; - } - - // create new blob - if (isc_create_blob(stat, &session_.dbhp_, &session_.trhp_, - &bhp_, &bid_)) - { - throwISCError(stat); - } - - if (data_.size() > 0) - { - // write data - if (isc_put_segment(stat, &bhp_, - static_cast<unsigned short>(data_.size()), &data_[0])) - { - throwISCError(stat); - } - } - - cleanUp(); - from_db_ = true; -} - -// retrives number of segments and total length of BLOB -// returns total length of BLOB -long FirebirdBLOBBackEnd::getBLOBInfo() -{ - char blob_items[] = {isc_info_blob_max_segment, isc_info_blob_total_length}; - char res_buffer[20], *p, item; - short length; - long total_length = 0; - - ISC_STATUS stat[20]; - - if (isc_blob_info(stat, &bhp_, sizeof(blob_items), blob_items, - sizeof(res_buffer), res_buffer)) - { - throwISCError(stat); - } - - for (p = res_buffer; *p != isc_info_end ;) - { - item = *p++; - length = static_cast<short>(isc_vax_integer(p, 2)); - p += 2; - switch (item) - { - case isc_info_blob_max_segment: - max_seg_size_ = isc_vax_integer(p, length); - break; - case isc_info_blob_total_length: - total_length = isc_vax_integer(p, length); - break; - case isc_info_truncated: - throw SOCIError("Fatal Error: BLOB info truncated!"); - break; - default: - break; - } - p += length; - } - - return total_length; -} diff --git a/src/backends/firebird/common.cpp b/src/backends/firebird/common.cpp deleted file mode 100644 index 54693b54..00000000 --- a/src/backends/firebird/common.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "common.h" -#include <soci-backend.h> -#include <ibase.h> // FireBird -#include <cstddef> -#include <cstring> -#include <sstream> -#include <string> - -namespace SOCI -{ - - namespace details - { - - namespace Firebird - { - - - char * allocBuffer(XSQLVAR* var) - { - std::size_t size; - if ((var->sqltype & ~1) == SQL_VARYING) - { - size = var->sqllen + sizeof(short); - } - else - { - size = var->sqllen; - } - - return new char[size]; - } - - void tmEncode(short type, std::tm * src, void * dst) - { - switch (type & ~1) - { - // In Interbase v6 DATE represents a date-only data type, - // in InterBase v5 DATE represents a date+time data type. - case SQL_TIMESTAMP: - isc_encode_timestamp(src, static_cast<ISC_TIMESTAMP*>(dst)); - break; - case SQL_TYPE_TIME: - isc_encode_sql_time(src, static_cast<ISC_TIME*>(dst)); - break; - case SQL_TYPE_DATE: - isc_encode_sql_date(src, static_cast<ISC_DATE*>(dst)); - break; - default: - std::ostringstream msg; - msg << "Unexpected type of date/time field (" << type << ")"; - throw SOCIError(msg.str()); - } - } - - void tmDecode(short type, void * src, std::tm * dst) - { - switch (type & ~1) - { - case SQL_TIMESTAMP: - isc_decode_timestamp(static_cast<ISC_TIMESTAMP*>(src), dst); - break; - case SQL_TYPE_TIME: - isc_decode_sql_time(static_cast<ISC_TIME*>(src), dst); - break; - case SQL_TYPE_DATE: - isc_decode_sql_date(static_cast<ISC_DATE*>(src), dst); - break; - default: - std::ostringstream msg; - msg << "Unexpected type of date/time field (" << type << ")"; - throw SOCIError(msg.str()); - } - } - - void setTextParam(char const * s, std::size_t size, char * buf_, - XSQLVAR * var) - { - short sz = 0; - if (size < static_cast<std::size_t>(var->sqllen)) - { - sz = static_cast<short>(size); - } - else - { - sz = var->sqllen; - } - - if ((var->sqltype & ~1) == SQL_VARYING) - { - memcpy(buf_, &sz, sizeof(short)); - memcpy(buf_ + sizeof(short), s, sz); - } - else if ((var->sqltype & ~1) == SQL_TEXT) - { - memcpy(buf_, s, sz); - if (sz < var->sqllen) - memset(buf_+sz, ' ', var->sqllen - sz); - } - else - { - throw SOCIError("Unexpected string type."); - } - } - - std::string getTextParam(XSQLVAR const *var) - { - short size; - std::size_t offset = 0; - - if ((var->sqltype & ~1) == SQL_VARYING) - { - size = *reinterpret_cast<short*>(var->sqldata); - offset = sizeof(short); - } - else if ((var->sqltype & ~1) == SQL_TEXT) - { - size = var->sqllen; - } - else throw SOCIError("Unexpected string type"); - - return std::string(var->sqldata + offset, size); - } - - } // namespace Firebird - - } // namespace details - -} // namespace SOCI diff --git a/src/backends/firebird/common.h b/src/backends/firebird/common.h deleted file mode 100644 index 1ee6f500..00000000 --- a/src/backends/firebird/common.h +++ /dev/null @@ -1,145 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef FIREBIRD_COMMON_H_INCLUDED -#define FIREBIRD_COMMON_H_INCLUDED - -#include "soci-firebird.h" -#include <limits> -#include <sstream> - -namespace SOCI -{ - - namespace details - { - - namespace Firebird - { - - char * allocBuffer(XSQLVAR* var); - - void tmEncode(short type, std::tm * src, void * dst); - - void tmDecode(short type, void * src, std::tm * dst); - - void setTextParam(char const * s, std::size_t size, char * buf_, - XSQLVAR * var); - - std::string getTextParam(XSQLVAR const *var); - - template<typename T1> - void to_isc(void * val, XSQLVAR * var) - { - T1 value = *reinterpret_cast<T1*>(val); - short scale = var->sqlscale; - short type = var->sqltype & ~1; - ISC_INT64 tens = 1; - - if (!std::numeric_limits<T1>::is_integer && scale >= 0 && - (type == SQL_SHORT || type == SQL_LONG || type == SQL_INT64)) - { - throw SOCIError("Can't convert non-integral value to integral column type"); - } - - for (int i = 0; i > scale; --i) - { - tens *= 10; - } - - switch (var->sqltype & ~1) - { - case SQL_SHORT: - { - short tmp = static_cast<short>(value*tens); - memcpy(var->sqldata, &tmp, sizeof(short)); - } - break; - case SQL_LONG: - { - long tmp = static_cast<long>(value*tens); - memcpy(var->sqldata, &tmp, sizeof(long)); - } - break; - case SQL_INT64: - { - ISC_INT64 tmp = static_cast<ISC_INT64>(value*tens); - memcpy(var->sqldata, &tmp, sizeof(ISC_INT64)); - } - break; - case SQL_FLOAT: - memcpy(var->sqldata, &value, sizeof(float)); - break; - case SQL_DOUBLE: - memcpy(var->sqldata, &value, sizeof(double)); - break; - default: - throw SOCIError("Incorrect data type for numeric conversion"); - } - } - - template<typename T1> - T1 from_isc(XSQLVAR * var) - { - short scale = var->sqlscale; - T1 tens = 1; - - if (scale < 0) - { - if (std::numeric_limits<T1>::is_integer) - { - std::ostringstream msg; - msg << "Can't convert value with scale " << -scale - << " to integral type"; - throw SOCIError(msg.str()); - } - - for (int i = 0; i > scale; --i) - { - tens *= 10; - } - } - - switch (var->sqltype & ~1) - { - case SQL_SHORT: - return static_cast<T1>(*reinterpret_cast<short*>(var->sqldata)/tens); - case SQL_LONG: - return static_cast<T1>(*reinterpret_cast<long*>(var->sqldata)/tens); - case SQL_INT64: - return static_cast<T1>(*reinterpret_cast<ISC_INT64*>(var->sqldata)/tens); - case SQL_FLOAT: - return static_cast<T1>(*reinterpret_cast<float*>(var->sqldata)); - case SQL_DOUBLE: - return static_cast<T1>(*reinterpret_cast<double*>(var->sqldata)); - default: - throw SOCIError("Incorrect data type for numeric conversion"); - } - } - - template <typename T> - std::size_t getVectorSize(void *p) - { - std::vector<T> *v = static_cast<std::vector<T> *>(p); - return v->size(); - } - - template <typename T> - void resizeVector(void *p, std::size_t sz) - { - std::vector<T> *v = static_cast<std::vector<T> *>(p); - v->resize(sz); - } - - } // namespace Firebird - - } // namespace details - -} // namespace SOCI - -#endif // FIREBIRD_COMMON_H_INCLUDED - diff --git a/src/backends/firebird/error.cpp b/src/backends/firebird/error.cpp deleted file mode 100644 index b098f9ea..00000000 --- a/src/backends/firebird/error.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" -#include "error.h" - -namespace SOCI -{ - - FirebirdSOCIError::FirebirdSOCIError(std::string const & msg, ISC_STATUS const * status) - : SOCIError(msg) - { - if (status != 0) - { - std::size_t i = 0; - while (i < stat_size && status[i] != 0) - { - status_.push_back(status[i++]); - } - } - } - - namespace details - { - - namespace Firebird - { - - void getISCErrorDetails(ISC_STATUS * status_vector, std::string &msg) - { - char msg_buffer[SOCI_FIREBIRD_ERRMSG]; - long *pvector = status_vector; - - try - { - // fetching first error message - isc_interprete(msg_buffer, &pvector); - msg = msg_buffer; - - // fetching next errors - while (isc_interprete(msg_buffer, &pvector)) - { - msg += "\n"; - msg += msg_buffer; - } - } - catch (...) - { - throw SOCIError("Exception catched while fetching error information"); - } - } - - bool checkISCError(ISC_STATUS const * status_vector, long errNum) - { - std::size_t i=0; - while (status_vector[i] != 0) - { - if (status_vector[i] == 1 && status_vector[i+1] == errNum) - { - return true; - } - ++i; - } - - return false; - } - void throwISCError(ISC_STATUS * status_vector) - { - std::string msg; - - getISCErrorDetails(status_vector, msg); - throw FirebirdSOCIError(msg, status_vector); - } - - } // namespace Firebird - - } // namespace details - -} // namespace SOCI diff --git a/src/backends/firebird/error.h b/src/backends/firebird/error.h deleted file mode 100644 index 9a581565..00000000 --- a/src/backends/firebird/error.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef FIREBIRD_ERROR_H_INCLUDED -#define FIREBIRD_ERROR_H_INCLUDED - -#include "soci-firebird.h" - -namespace SOCI -{ - - namespace details - { - - namespace Firebird - { - - void SOCI_FIREBIRD_DECL getISCErrorDetails(ISC_STATUS * status_vector, std::string &msg); - - bool SOCI_FIREBIRD_DECL checkISCError(ISC_STATUS const * status_vector, long errNum); - - void SOCI_FIREBIRD_DECL throwISCError(ISC_STATUS * status_vector); - - } // namespace Firebird - - } // namespace details - -} // namespace SOCI - -#endif // FIREBIRD_ERROR_H_INCLUDED - diff --git a/src/backends/firebird/factory.cpp b/src/backends/firebird/factory.cpp deleted file mode 100644 index f1d5da05..00000000 --- a/src/backends/firebird/factory.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" - -using namespace SOCI; - -FirebirdSessionBackEnd * FirebirdBackEndFactory::makeSession( - std::string const &connectString) const -{ - return new FirebirdSessionBackEnd(connectString); -} - -FirebirdBackEndFactory const SOCI::firebird; diff --git a/src/backends/firebird/row-id.cpp b/src/backends/firebird/row-id.cpp deleted file mode 100644 index 98a39698..00000000 --- a/src/backends/firebird/row-id.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" - -using namespace SOCI; - -FirebirdRowIDBackEnd::FirebirdRowIDBackEnd(FirebirdSessionBackEnd & /* session */) -{ - // Unsupported in Firebird backend - throw SOCIError("RowIDs are not supported"); -} - -FirebirdRowIDBackEnd::~FirebirdRowIDBackEnd() -{ - // Unsupported in Firebird backend - throw SOCIError("RowIDs are not supported"); -} diff --git a/src/backends/firebird/session.cpp b/src/backends/firebird/session.cpp deleted file mode 100644 index 27ad2dab..00000000 --- a/src/backends/firebird/session.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" -#include "error.h" -#include <map> -#include <sstream> -#include <string> - -using namespace SOCI; -using namespace SOCI::details::Firebird; - -namespace -{ -// retrieves parameters from the uniform connect string - void explodeISCConnectString(std::string const &connectString, - std::map<std::string, std::string> ¶meters) - { - std::string tmp; - for (std::string::const_iterator i = connectString.begin(), - end = connectString.end(); i != end; ++i) - { - if (*i == '=') - { - tmp += ' '; - } - else - { - tmp += *i; - } - } - - parameters.clear(); - - std::istringstream iss(tmp); - std::string key, value; - while (iss >> key >> value) - { - parameters.insert(std::pair<std::string, std::string>(key, value)); - } - } - -// extracts given parameter from map previusly build with explodeISCConnectString - bool getISCConnectParameter(std::map<std::string, std::string> const & m, std::string const & key, - std::string & value) - { - std::map <std::string, std::string> :: const_iterator i; - value.clear(); - - i = m.find(key); - - if (i != m.end()) - { - value = i->second; - return true; - } - else - { - return false; - } - } - -} // namespace anonymous - -FirebirdSessionBackEnd::FirebirdSessionBackEnd( - std::string const & connectString) : dbhp_(0), trhp_(0) -{ - // extract connection parameters - std::map<std::string, std::string> params; - explodeISCConnectString(connectString, params); - - ISC_STATUS stat[stat_size]; - std::string param; - - // preparing connection options - if (getISCConnectParameter(params, "user", param)) - setDPBOption(isc_dpb_user_name, param); - - if (getISCConnectParameter(params, "password", param)) - setDPBOption(isc_dpb_password, param); - - if (getISCConnectParameter(params, "role", param)) - setDPBOption(isc_dpb_sql_role_name, param); - - if (getISCConnectParameter(params, "charset", param)) - setDPBOption(isc_dpb_lc_ctype, param); - - if (!getISCConnectParameter(params, "service", param)) - throw SOCIError("Service name not specified."); - - // connecting data base - if (isc_attach_database(stat, static_cast<short>(param.size()), - const_cast<char*>(param.c_str()), &dbhp_, - static_cast<short>(dpb_.size()), const_cast<char*>(dpb_.c_str()))) - { - throwISCError(stat); - } - - // starting transaction - begin(); -} - - -void FirebirdSessionBackEnd::begin() -{ - // Transaction is always started in ctor, because Firebird can't work - // without active transaction. - // Transaction will be automatically commited in cleanUp method. - if (trhp_ == 0) - { - ISC_STATUS stat[stat_size]; - if (isc_start_transaction(stat, &trhp_, 1, &dbhp_, 0, NULL)) - { - throwISCError(stat); - } - } -} - -FirebirdSessionBackEnd::~FirebirdSessionBackEnd() -{ - cleanUp(); -} - -void FirebirdSessionBackEnd::setDPBOption(int const option, std::string const & value) -{ - - if (dpb_.size() == 0) - { - dpb_.append(1, static_cast<char>(isc_dpb_version1)); - } - - // now we are adding new option - dpb_.append(1, static_cast<char>(option)); - dpb_.append(1, static_cast<char>(value.size())); - dpb_.append(value); -} - -void FirebirdSessionBackEnd::commit() -{ - ISC_STATUS stat[stat_size]; - - if (trhp_ != 0) - { - if (isc_commit_transaction(stat, &trhp_)) - { - throwISCError(stat); - } - - trhp_ = 0; - } - -#ifndef SOCI_FIREBIRD_NORESTARTTRANSACTION - begin(); -#endif - -} - -void FirebirdSessionBackEnd::rollback() -{ - ISC_STATUS stat[stat_size]; - - if (trhp_ != 0) - { - if (isc_rollback_transaction(stat, &trhp_)) - { - throwISCError(stat); - } - - trhp_ = 0; - } - -#ifndef SOCI_FIREBIRD_NORESTARTTRANSACTION - begin(); -#endif - -} - -void FirebirdSessionBackEnd::cleanUp() -{ - ISC_STATUS stat[stat_size]; - - // at the end of session our transaction is finally commited. - if (trhp_ != 0) - { - if (isc_commit_transaction(stat, &trhp_)) - { - throwISCError(stat); - } - - trhp_ = 0; - } - - if (isc_detach_database(stat, &dbhp_)) - { - throwISCError(stat); - } - - dbhp_ = 0L; -} - -FirebirdStatementBackEnd * FirebirdSessionBackEnd::makeStatementBackEnd() -{ - return new FirebirdStatementBackEnd(*this); -} - -FirebirdRowIDBackEnd * FirebirdSessionBackEnd::makeRowIDBackEnd() -{ - return new FirebirdRowIDBackEnd(*this); -} - -FirebirdBLOBBackEnd * FirebirdSessionBackEnd::makeBLOBBackEnd() -{ - return new FirebirdBLOBBackEnd(*this); -} - - diff --git a/src/backends/firebird/soci-firebird.h b/src/backends/firebird/soci-firebird.h deleted file mode 100644 index b525795d..00000000 --- a/src/backends/firebird/soci-firebird.h +++ /dev/null @@ -1,324 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// - -#ifndef SOCI_FIREBIRD_H_INCLUDED -#define SOCI_FIREBIRD_H_INCLUDED - -#ifdef _WIN32 -# ifdef SOCI_DLL -# ifdef SOCI_FIREBIRD_SOURCE -# define SOCI_FIREBIRD_DECL __declspec(dllexport) -# else -# define SOCI_FIREBIRD_DECL __declspec(dllimport) -# endif // SOCI_FIREBIRD_SOURCE -# endif // SOCI_DLL -#endif // _WIN32 -// -// If SOCI_FIREBIRD_DECL isn't defined yet define it now -#ifndef SOCI_FIREBIRD_DECL -# define SOCI_FIREBIRD_DECL -#endif - -#include <soci-backend.h> -#include <ibase.h> // FireBird -#include <vector> - -namespace SOCI -{ - - std::size_t const stat_size = 20; - -// size of buffer for error messages. All examples use this value. -// Anyone knows, where it is stated that 512 bytes is enough ? - std::size_t const SOCI_FIREBIRD_ERRMSG = 512; - - class SOCI_FIREBIRD_DECL FirebirdSOCIError : public SOCIError - { - public: - FirebirdSOCIError(std::string const & msg, - ISC_STATUS const * status = 0); - - ~FirebirdSOCIError() throw() - {}; - - std::vector<ISC_STATUS> status_; - }; - - - enum BuffersType - { - eStandard, eVector - }; - - struct FirebirdStatementBackEnd; - struct FirebirdStandardIntoTypeBackEnd : details::StandardIntoTypeBackEnd - { - FirebirdStandardIntoTypeBackEnd(FirebirdStatementBackEnd &st) - : statement_(st), buf_(NULL) - {} - - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); - - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind); - - virtual void cleanUp(); - - FirebirdStatementBackEnd &statement_; - virtual void exchangeData(); - - void *data_; - details::eExchangeType type_; - int position_; - - char *buf_; - short indISCHolder_; - }; - - struct FirebirdVectorIntoTypeBackEnd : details::VectorIntoTypeBackEnd - { - FirebirdVectorIntoTypeBackEnd(FirebirdStatementBackEnd &st) - : statement_(st), buf_(NULL) - {} - - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); - - virtual void preFetch(); - virtual void postFetch(bool gotData, eIndicator *ind); - - virtual void resize(std::size_t sz); - virtual std::size_t size(); - - virtual void cleanUp(); - - FirebirdStatementBackEnd &statement_; - virtual void exchangeData(std::size_t row); - - void *data_; - details::eExchangeType type_; - int position_; - - char *buf_; - short indISCHolder_; - }; - - struct FirebirdStandardUseTypeBackEnd : details::StandardUseTypeBackEnd - { - FirebirdStandardUseTypeBackEnd(FirebirdStatementBackEnd &st) - : statement_(st), buf_(NULL), indISCHolder_(0) - {} - - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); - - virtual void preUse(eIndicator const *ind); - virtual void postUse(bool gotData, eIndicator *ind); - - virtual void cleanUp(); - - FirebirdStatementBackEnd &statement_; - virtual void exchangeData(); - - void *data_; - details::eExchangeType type_; - int position_; - - char *buf_; - short indISCHolder_; - }; - - struct FirebirdVectorUseTypeBackEnd : details::VectorUseTypeBackEnd - { - FirebirdVectorUseTypeBackEnd(FirebirdStatementBackEnd &st) - : statement_(st), inds_(NULL), buf_(NULL), indISCHolder_(0) - {} - - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); - - virtual void preUse(eIndicator const *ind); - - virtual std::size_t size(); - - virtual void cleanUp(); - - FirebirdStatementBackEnd &statement_; - virtual void exchangeData(std::size_t row); - - void *data_; - details::eExchangeType type_; - int position_; - eIndicator const *inds_; - - char *buf_; - short indISCHolder_; - }; - - struct FirebirdSessionBackEnd; - struct FirebirdStatementBackEnd : details::StatementBackEnd - { - FirebirdStatementBackEnd(FirebirdSessionBackEnd &session); - - virtual void alloc(); - virtual void cleanUp(); - virtual void prepare(std::string const &query, - details::eStatementType eType); - - virtual execFetchResult execute(int number); - virtual execFetchResult fetch(int number); - - virtual int getNumberOfRows(); - - virtual std::string rewriteForProcedureCall(std::string const &query); - - virtual int prepareForDescribe(); - virtual void describeColumn(int colNum, eDataType &dtype, - std::string &columnName); - - virtual FirebirdStandardIntoTypeBackEnd * makeIntoTypeBackEnd(); - virtual FirebirdStandardUseTypeBackEnd * makeUseTypeBackEnd(); - virtual FirebirdVectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd(); - virtual FirebirdVectorUseTypeBackEnd * makeVectorUseTypeBackEnd(); - - FirebirdSessionBackEnd &session_; - - isc_stmt_handle stmtp_; - XSQLDA * sqldap_; - XSQLDA * sqlda2p_; - - bool boundByName_; - bool boundByPos_; - - friend struct FirebirdVectorIntoTypeBackEnd; - friend struct FirebirdStandardIntoTypeBackEnd; - friend struct FirebirdVectorUseTypeBackEnd; - friend struct FirebirdStandardUseTypeBackEnd; - -protected: - int rowsFetched_; - - virtual void exchangeData(bool gotData, int row); - virtual void prepareSQLDA(XSQLDA ** sqldap, int size = 10); - virtual void rewriteQuery(std::string const & query, - std::vector<char> & buffer); - virtual void rewriteParameters(std::string const & src, - std::vector<char> & dst); - - BuffersType intoType_; - BuffersType useType_; - - std::vector<std::vector<eIndicator> > inds_; - std::vector<void*> intos_; - std::vector<void*> uses_; - - // named parameters - std::map <std::string, int> names_; - - bool procedure_; - }; - - struct FirebirdRowIDBackEnd : details::RowIDBackEnd - { - FirebirdRowIDBackEnd(FirebirdSessionBackEnd &session); - - ~FirebirdRowIDBackEnd(); - }; - - struct FirebirdBLOBBackEnd : details::BLOBBackEnd - { - FirebirdBLOBBackEnd(FirebirdSessionBackEnd &session); - - ~FirebirdBLOBBackEnd(); - - virtual std::size_t getLen(); - virtual std::size_t read(std::size_t offset, char *buf, - std::size_t toRead); - virtual std::size_t write(std::size_t offset, char const *buf, - std::size_t toWrite); - virtual std::size_t append(char const *buf, std::size_t toWrite); - virtual void trim(std::size_t newLen); - - FirebirdSessionBackEnd &session_; - - virtual void save(); - virtual void assign(ISC_QUAD const & bid) - { - cleanUp(); - - bid_ = bid; - from_db_ = true; - } - - // BLOB id from in database - ISC_QUAD bid_; - - // BLOB id was fetched from database (true) - // or this is new BLOB - bool from_db_; - - // BLOB handle - isc_blob_handle bhp_; - -protected: - - virtual void open(); - virtual long getBLOBInfo(); - virtual void load(); - virtual void writeBuffer(std::size_t offset, char const * buf, - std::size_t toWrite); - virtual void cleanUp(); - - // buffer for BLOB data - std::vector<char> data_; - - bool loaded_; - long max_seg_size_; - }; - - struct FirebirdSessionBackEnd : details::SessionBackEnd - { - FirebirdSessionBackEnd(std::string const &connectString); - - ~FirebirdSessionBackEnd(); - - virtual void begin(); - virtual void commit(); - virtual void rollback(); - - void cleanUp(); - - virtual FirebirdStatementBackEnd * makeStatementBackEnd(); - virtual FirebirdRowIDBackEnd * makeRowIDBackEnd(); - virtual FirebirdBLOBBackEnd * makeBLOBBackEnd(); - - virtual void setDPBOption(int const option, std::string const & value); - - isc_db_handle dbhp_; - isc_tr_handle trhp_; - std::string dpb_; - }; - - struct FirebirdBackEndFactory : BackEndFactory - { - virtual FirebirdSessionBackEnd * makeSession( - std::string const &connectString) const; - }; - - SOCI_FIREBIRD_DECL extern FirebirdBackEndFactory const firebird; - -} // namespace SOCI - -#endif // SOCI_FIREBIRD_H_INCLUDED - diff --git a/src/backends/firebird/standard-into-type.cpp b/src/backends/firebird/standard-into-type.cpp deleted file mode 100644 index 87a39185..00000000 --- a/src/backends/firebird/standard-into-type.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" -#include "common.h" -#include <soci.h> - -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Firebird; - -void FirebirdStandardIntoTypeBackEnd::defineByPos( - int & position, void * data, eExchangeType type) -{ - position_ = position-1; - data_ = data; - type_ = type; - - ++position; - - statement_.intoType_ = eStandard; - statement_.intos_.push_back(static_cast<void*>(this)); - - XSQLVAR *var = statement_.sqldap_->sqlvar+position_; - - buf_ = allocBuffer(var); - var->sqldata = buf_; - var->sqlind = &indISCHolder_; -} - -void FirebirdStandardIntoTypeBackEnd::preFetch() -{ - // nothing to do -} - -void FirebirdStandardIntoTypeBackEnd::postFetch( - bool gotData, bool calledFromFetch, eIndicator * ind) -{ - if (calledFromFetch == true && gotData == false) - { - // this is a normal end-of-rowset condition, - // no need to set anything (fetch() will return false) - return; - } - - if (gotData) - { - if (statement_.inds_[position_][0] == eNull && ind == NULL) - { - throw SOCIError("Null value fetched and no indicator defined."); - } - else if (ind != NULL) - { - *ind = statement_.inds_[position_][0]; - } - } - else - { - if (ind == NULL) - { - throw SOCIError("No data fetched and no indicator defined."); - } - - *ind = eNoData; - } -} - - -void FirebirdStandardIntoTypeBackEnd::exchangeData() -{ - XSQLVAR *var = statement_.sqldap_->sqlvar+position_; - - switch (type_) - { - // simple cases - case eXChar: - *reinterpret_cast<char*>(data_) = getTextParam(var)[0]; - break; - case eXShort: - { - short t = from_isc<short>(var); - *reinterpret_cast<short*>(data_) = t; - } - break; - case eXInteger: - { - int t = from_isc<int>(var); - *reinterpret_cast<int*>(data_) = t; - } - break; - case eXUnsignedLong: - { - unsigned long t = from_isc<unsigned long>(var); - *reinterpret_cast<unsigned long*>(data_) = t; - } - break; - case eXDouble: - { - double t = from_isc<double>(var); - *reinterpret_cast<double*>(data_) = t; - } - break; - - // cases that require adjustments and buffer management - case eXCString: - { - details::CStringDescriptor *tmp = - static_cast<details::CStringDescriptor*>(data_); - - std::string stmp = getTextParam(var); - std::strncpy(tmp->str_, stmp.c_str(), tmp->bufSize_ - 1); - tmp->str_[tmp->bufSize_ - 1] = '\0'; - - if (stmp.size() >= tmp->bufSize_) - { - statement_.inds_[position_][0] = eTruncated; - } - } - break; - case eXStdString: - *(reinterpret_cast<std::string*>(data_)) = getTextParam(var); - break; - case eXStdTm: - tmDecode(var->sqltype, - buf_, static_cast<std::tm*>(data_)); - break; - - // cases that require special handling - case eXBLOB: - { - BLOB *tmp = reinterpret_cast<BLOB*>(data_); - - FirebirdBLOBBackEnd *blob = - dynamic_cast<FirebirdBLOBBackEnd *>(tmp->getBackEnd()); - - if (blob==0) - { - throw SOCIError("Can't get Firebid BLOB BackEnd"); - } - - blob->assign(*reinterpret_cast<ISC_QUAD*>(buf_)); - } - break; - default: - throw SOCIError("Into element used with non-supported type."); - } // switch -} - -void FirebirdStandardIntoTypeBackEnd::cleanUp() -{ - if (buf_ != NULL) - { - delete[] buf_; - buf_ = NULL; - } -} diff --git a/src/backends/firebird/standard-use-type.cpp b/src/backends/firebird/standard-use-type.cpp deleted file mode 100644 index ecfc1047..00000000 --- a/src/backends/firebird/standard-use-type.cpp +++ /dev/null @@ -1,179 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" -#include "common.h" -#include <soci.h> - -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Firebird; - -void FirebirdStandardUseTypeBackEnd::bindByPos( - int & position, void * data, eExchangeType type) -{ - if (statement_.boundByName_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - position_ = position-1; - data_ = data; - type_ = type; - - ++position; - - statement_.useType_ = eStandard; - statement_.uses_.push_back(static_cast<void*>(this)); - - XSQLVAR *var = statement_.sqlda2p_->sqlvar+position_; - - buf_ = allocBuffer(var); - var->sqldata = buf_; - var->sqlind = &indISCHolder_; - - statement_.boundByPos_ = true; -} - -void FirebirdStandardUseTypeBackEnd::bindByName( - std::string const & name, void * data, - eExchangeType type) -{ - if (statement_.boundByPos_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - std::map <std::string, int> :: iterator idx = - statement_.names_.find(name); - - if (idx == statement_.names_.end()) - { - throw SOCIError("Missing use element for bind by name (" + name + ")"); - } - - position_ = idx->second; - data_ = data; - type_ = type; - - statement_.useType_ = eStandard; - statement_.uses_.push_back(static_cast<void*>(this)); - - XSQLVAR *var = statement_.sqlda2p_->sqlvar+position_; - - buf_ = allocBuffer(var); - var->sqldata = buf_; - var->sqlind = &indISCHolder_; - - statement_.boundByName_ = true; -} - -void FirebirdStandardUseTypeBackEnd::preUse(eIndicator const * ind) -{ - if (ind) - { - switch (*ind) - { - case eNull: - indISCHolder_ = -1; - break; - case eOK: - indISCHolder_ = 0; - break; - default: - throw SOCIError("Unsupported indicator value."); - } - } -} - -void FirebirdStandardUseTypeBackEnd::exchangeData() -{ - XSQLVAR *var = statement_.sqlda2p_->sqlvar+position_; - - switch (type_) - { - case eXChar: - setTextParam(static_cast<char*>(data_), 1, buf_, var); - break; - case eXShort: - to_isc<short>(data_, var); - break; - case eXInteger: - to_isc<int>(data_, var); - break; - case eXUnsignedLong: - to_isc<unsigned long>(data_, var); - break; - case eXDouble: - to_isc<double>(data_, var); - break; - - // cases that require adjustments and buffer management - case eXCString: - { - details::CStringDescriptor *tmp - = static_cast<CStringDescriptor *>(data_); - - // remove trailing nulls - while (tmp->str_[tmp->bufSize_-1] == '\0') - { - --tmp->bufSize_; - } - - setTextParam(tmp->str_, tmp->bufSize_, buf_, var); - } - break; - case eXStdString: - { - std::string *tmp = static_cast<std::string*>(data_); - setTextParam(tmp->c_str(), tmp->size(), buf_, var); - } - break; - case eXStdTm: - tmEncode(var->sqltype, - static_cast<std::tm*>(data_), buf_); - break; - - // cases that require special handling - case eXBLOB: - { - BLOB *tmp = static_cast<BLOB*>(data_); - - FirebirdBLOBBackEnd *blob = - dynamic_cast<FirebirdBLOBBackEnd *>(tmp->getBackEnd()); - - if (blob==0) - { - throw SOCIError("Can't get Firebid BLOB BackEnd"); - } - - blob->save(); - memcpy(buf_, &blob->bid_, var->sqllen); - } - break; - default: - throw SOCIError("Use element used with non-supported type."); - } // switch -} - -void FirebirdStandardUseTypeBackEnd::postUse( - bool /* gotData */, eIndicator * /* ind */) -{ - // ... -} - -void FirebirdStandardUseTypeBackEnd::cleanUp() -{ - if (buf_ != NULL) - { - delete[] buf_; - buf_ = NULL; - } -} diff --git a/src/backends/firebird/statement.cpp b/src/backends/firebird/statement.cpp deleted file mode 100644 index 04726f44..00000000 --- a/src/backends/firebird/statement.cpp +++ /dev/null @@ -1,646 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" -#include "error.h" -#include <cctype> -#include <sstream> - -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Firebird; - -FirebirdStatementBackEnd::FirebirdStatementBackEnd(FirebirdSessionBackEnd &session) - : session_(session), stmtp_(0), sqldap_(NULL), sqlda2p_(NULL), rowsFetched_(0), - intoType_(eStandard), useType_(eStandard), procedure_(false), boundByName_(false), - boundByPos_(false) -{} - -void FirebirdStatementBackEnd::prepareSQLDA(XSQLDA ** sqldap, int size) -{ - if (*sqldap != NULL) - { - *sqldap = reinterpret_cast<XSQLDA*>(realloc(*sqldap,XSQLDA_LENGTH(size))); - } - else - { - *sqldap = reinterpret_cast<XSQLDA*>(malloc(XSQLDA_LENGTH(size))); - } - - (*sqldap)->sqln = size; - (*sqldap)->version = 1; -} - -void FirebirdStatementBackEnd::alloc() -{ - ISC_STATUS stat[stat_size]; - - if (isc_dsql_allocate_statement(stat, &session_.dbhp_, &stmtp_)) - { - throwISCError(stat); - } -} - -void FirebirdStatementBackEnd::cleanUp() -{ - ISC_STATUS stat[stat_size]; - - if (stmtp_ != NULL) - { - if (isc_dsql_free_statement(stat, &stmtp_, DSQL_drop)) - { - throwISCError(stat); - } - stmtp_ = NULL; - } - - if (sqldap_ != NULL) - { - free(sqldap_); - sqldap_ = NULL; - } - - if (sqlda2p_ != NULL) - { - free(sqlda2p_); - sqlda2p_ = NULL; - } -} - -void FirebirdStatementBackEnd::rewriteParameters( - std::string const & src, std::vector<char> & dst) -{ - std::vector<char>::iterator dst_it = dst.begin(); - - // rewrite the query by transforming all named parameters into - // the Firebird question marks (:abc -> ?, etc.) - - enum { eNormal, eInQuotes, eInName } state = eNormal; - - std::string name; - int position = 0; - - for (std::string::const_iterator it = src.begin(), end = src.end(); - it != end; ++it) - { - switch (state) - { - case eNormal: - if (*it == '\'') - { - *dst_it++ = *it; - state = eInQuotes; - } - else if (*it == ':') - { - state = eInName; - } - else // regular character, stay in the same state - { - *dst_it++ = *it; - } - break; - case eInQuotes: - if (*it == '\'') - { - *dst_it++ = *it; - state = eNormal; - } - else // regular quoted character - { - *dst_it++ = *it; - } - break; - case eInName: - if (std::isalnum(*it) || *it == '_') - { - name += *it; - } - else // end of name - { - names_.insert(std::pair<std::string, int>(name, position++)); - name.clear(); - *dst_it++ = '?'; - *dst_it++ = *it; - state = eNormal; - } - break; - } - } - - if (state == eInName) - { - names_.insert(std::pair<std::string, int>(name, position++)); - *dst_it++ = '?'; - } - - *dst_it = '\0'; -} - -namespace -{ - int statementType(isc_stmt_handle stmt) - { - int statement_type; - int length; - char type_item[] = {isc_info_sql_stmt_type}; - char res_buffer[8]; - - ISC_STATUS stat[stat_size]; - - if (isc_dsql_sql_info(stat, &stmt, sizeof(type_item), - type_item, sizeof(res_buffer), res_buffer)) - { - throwISCError(stat); - } - - if (res_buffer[0] == isc_info_sql_stmt_type) - { - length = isc_vax_integer(res_buffer+1, 2); - statement_type = isc_vax_integer(res_buffer+3, length); - } - else - { - throw SOCIError("Can't determine statement type."); - } - - return statement_type; - } -} - -void FirebirdStatementBackEnd::rewriteQuery( - std::string const &query, std::vector<char> &buffer) -{ - // buffer for temporary query - std::vector<char> tmpQuery; - std::vector<char>::iterator qItr; - - // buffer for query with named parameters changed to standard ones - std::vector<char> rewQuery(query.size() + 1); - - // take care of named parameters in original query - rewriteParameters(query, rewQuery); - - std::string const prefix("execute procedure "); - std::string const prefix2("select * from "); - - // for procedures, we are preparing statement to determine - // type of procedure. - if (procedure_) - { - tmpQuery.resize(prefix.size() + rewQuery.size()); - qItr = tmpQuery.begin(); - std::copy(prefix.begin(), prefix.end(), qItr); - qItr += prefix.size(); - } - else - { - tmpQuery.resize(rewQuery.size()); - qItr = tmpQuery.begin(); - } - - // prepare temporary query - std::copy(rewQuery.begin(), rewQuery.end(), qItr); - - // preparing buffers for output parameters - if (sqldap_ == NULL) - { - prepareSQLDA(&sqldap_); - } - - ISC_STATUS stat[stat_size]; - isc_stmt_handle tmpStmtp = 0; - - // allocate temporary statement to determine its type - if (isc_dsql_allocate_statement(stat, &session_.dbhp_, &tmpStmtp)) - { - throwISCError(stat); - } - - // prepare temporary statement - if (isc_dsql_prepare(stat, &(session_.trhp_), &tmpStmtp, 0, - &tmpQuery[0], SQL_DIALECT_V6, sqldap_)) - { - throwISCError(stat); - } - - // get statement type - int stType = statementType(tmpStmtp); - - // free temporary prepared statement - if (isc_dsql_free_statement(stat, &tmpStmtp, DSQL_drop)) - { - throwISCError(stat); - } - - // take care of special cases - if (procedure_) - { - // for procedures that return values, we need to use correct syntax - if (sqldap_->sqld != 0) - { - // this is "select" procedure, so we have to change syntax - buffer.resize(prefix2.size() + rewQuery.size()); - qItr = buffer.begin(); - std::copy(prefix2.begin(), prefix2.end(), qItr); - qItr += prefix2.size(); - std::copy(rewQuery.begin(), rewQuery.end(), qItr); - - // that won't be needed anymore - procedure_ = false; - - return; - } - } - else - { - // this is not procedure, so syntax is ok except for named - // parameters in ddl - if (stType == isc_info_sql_stmt_ddl) - { - // this statement is a DDL - we can't rewrite named parameters - // so, we will use original query - buffer.resize(query.size() + 1); - std::copy(query.begin(), query.end(), buffer.begin()); - - // that won't be needed anymore - procedure_ = false; - - return; - } - } - - // here we know, that temporary query is OK, so we leave it as is - buffer.resize(tmpQuery.size()); - std::copy(tmpQuery.begin(), tmpQuery.end(), buffer.begin()); - - // that won't be needed anymore - procedure_ = false; -} - -void FirebirdStatementBackEnd::prepare(std::string const & query, - eStatementType /* eType */) -{ - // clear named parametes - names_.clear(); - - std::vector<char> queryBuffer; - - // modify query's syntax and prepare buffer for use with - // firebird's api - rewriteQuery(query, queryBuffer); - - ISC_STATUS stat[stat_size]; - - // prepare real statement - if (isc_dsql_prepare(stat, &(session_.trhp_), &stmtp_, 0, - &queryBuffer[0], SQL_DIALECT_V6, sqldap_)) - { - throwISCError(stat); - } - - if (sqldap_->sqln < sqldap_->sqld) - { - // sqlda is too small for all columns. it must be reallocated - prepareSQLDA(&sqldap_,sqldap_->sqld); - - if (isc_dsql_describe(stat, &stmtp_, SQL_DIALECT_V6, sqldap_)) - { - throwISCError(stat); - } - } - - // preparing input parameters - if (sqlda2p_ == NULL) - { - prepareSQLDA(&sqlda2p_); - } - - if (isc_dsql_describe_bind(stat, &stmtp_, SQL_DIALECT_V6, sqlda2p_)) - { - throwISCError(stat); - } - - if (sqlda2p_->sqln < sqlda2p_->sqld) - { - // sqlda is too small for all columns. it must be reallocated - prepareSQLDA(&sqlda2p_, sqlda2p_->sqld); - - if (isc_dsql_describe_bind(stat, &stmtp_, SQL_DIALECT_V6, sqlda2p_)) - { - throwISCError(stat); - } - } - - // prepare buffers for indicators - inds_.clear(); - inds_.resize(sqldap_->sqld); - - // reset types of into buffers - intoType_ = eStandard; - intos_.resize(0); - - // reset types of use buffers - useType_ = eStandard; - uses_.resize(0); -} - - -namespace -{ - void checkSize(std::size_t actual, std::size_t expected, - std::string const & name) - { - if (actual != expected) - { - std::ostringstream msg; - msg << "Incorrect number of " << name << " variables. " - << "Expected " << expected << ", got " << actual; - throw SOCIError(msg.str()); - } - } -} - -StatementBackEnd::execFetchResult -FirebirdStatementBackEnd::execute(int number) -{ - ISC_STATUS stat[stat_size]; - XSQLDA *t = NULL; - - std::size_t usize = uses_.size(); - - // do we have enough into variables ? - checkSize(intos_.size(), sqldap_->sqld, "into"); - // do we have enough use variables ? - checkSize(usize, sqlda2p_->sqld, "use"); - - // do we have parameters ? - if (sqlda2p_->sqld) - { - t = sqlda2p_; - - if (useType_ == eStandard) - { - for (std::size_t col=0; col<usize; ++col) - { - static_cast<FirebirdStandardUseTypeBackEnd*>(uses_[col])->exchangeData(); - } - } - } - - // make sure there is no active cursor - if (isc_dsql_free_statement(stat, &stmtp_, DSQL_close)) - { - // ignore attempt to close already closed cursor - if (!checkISCError(stat, isc_dsql_cursor_close_err)) - { - throwISCError(stat); - } - } - - if (useType_ == eVector) - { - // Here we have to explicitly loop to achieve the - // effect of inserting or updating with vector use elements. - std::size_t rows = static_cast<FirebirdVectorUseTypeBackEnd*>(uses_[0])->size(); - for (std::size_t row=0; row < rows; ++row) - { - // first we have to prepare input parameters - for (std::size_t col=0; col<usize; ++col) - { - static_cast<FirebirdVectorUseTypeBackEnd*>(uses_[col])->exchangeData(row); - } - - // then execute query - if (isc_dsql_execute(stat, &session_.trhp_, &stmtp_, SQL_DIALECT_V6, t)) - { - throwISCError(stat); - } - - // SOCI does not allow bulk insert/update and bulk select operations - // in same query. So here, we know that into elements are not - // vectors. So, there is no need to fetch data here. - } - } - else - { - // use elements aren't vectors - if (isc_dsql_execute(stat, &session_.trhp_, &stmtp_, SQL_DIALECT_V6, t)) - { - throwISCError(stat); - } - } - - if (sqldap_->sqld) - { - // query may return some data - if (number > 0) - { - // number contains size of input variables, so we may fetch() data here - return fetch(number); - } - else - { - // execute(0) was meant to only perform the query - return eSuccess; - } - } - else - { - // query can't return any data - return eNoData; - } -} - -StatementBackEnd::execFetchResult -FirebirdStatementBackEnd::fetch(int number) -{ - ISC_STATUS stat[stat_size]; - - for (size_t i = 0; i<static_cast<unsigned int>(sqldap_->sqld); ++i) - { - inds_[i].resize(number > 0 ? number : 1); - } - - // Here we have to explicitly loop to achieve the effect of fetching - // vector into elements. After each fetch, we have to exchange data - // with into buffers. - rowsFetched_ = 0; - for (int i = 0; i < number; ++i) - { - long fetch_stat = isc_dsql_fetch(stat, &stmtp_, SQL_DIALECT_V6, sqldap_); - - // there is more data to read - if (fetch_stat == 0) - { - ++rowsFetched_; - exchangeData(true, i); - } - else if (fetch_stat == 100L) - { - return eNoData; - } - else - { - // error - throwISCError(stat); - return eNoData; // unreachable, for compiler only - } - } // for - - return eSuccess; -} - -// here we put data fetched from database into user buffers -void FirebirdStatementBackEnd::exchangeData(bool gotData, int row) -{ - // first save indicators - for (size_t i = 0; i < static_cast<unsigned int>(sqldap_->sqld); ++i) - { - if (!gotData) - { - inds_[i][row] = eIndicator(eNoData); - } - else - { - if (((sqldap_->sqlvar+i)->sqltype & 1) == 0) - { - // there is no indicator for this column - inds_[i][row] = eOK; - } - else if (*((sqldap_->sqlvar+i)->sqlind) == 0) - { - inds_[i][row] = eOK; - } - else if (*((sqldap_->sqlvar+i)->sqlind) == -1) - { - inds_[i][row] = eNull; - } - else - { - throw SOCIError("Unknown state in FirebirdStatementBackEnd::exchangeData()"); - } - } - } - - // then deal with data - if (gotData) - { - for (size_t i = 0; i<static_cast<unsigned int>(sqldap_->sqld); ++i) - { - if (inds_[i][row] != eNull) - { - if (intoType_ == eVector) - { - static_cast<FirebirdVectorIntoTypeBackEnd*>( - intos_[i])->exchangeData(row); - } - else - { - static_cast<FirebirdStandardIntoTypeBackEnd*>( - intos_[i])->exchangeData(); - } - } - } - } -} - -int FirebirdStatementBackEnd::getNumberOfRows() -{ - return rowsFetched_; -} - -std::string FirebirdStatementBackEnd::rewriteForProcedureCall( - std::string const &query) -{ - procedure_ = true; - return query; -} - -int FirebirdStatementBackEnd::prepareForDescribe() -{ - return static_cast<int>(sqldap_->sqld); -} - -void FirebirdStatementBackEnd::describeColumn(int colNum, - eDataType & type, std::string & columnName) -{ - XSQLVAR * var = sqldap_->sqlvar+(colNum-1); - - columnName.assign(var->aliasname, var->aliasname_length); - - switch (var->sqltype & ~1) - { - case SQL_TEXT: - case SQL_VARYING: - type = eString; - break; - case SQL_TYPE_DATE: - case SQL_TYPE_TIME: - case SQL_TIMESTAMP: - type = eDate; - break; - case SQL_FLOAT: - case SQL_DOUBLE: - type = eDouble; - break; - case SQL_SHORT: - case SQL_LONG: - if (var->sqlscale < 0) - { - type = eDouble; - } - else - { - type = eInteger; - } - break; - case SQL_INT64: - if (var->sqlscale < 0) - { - type = eDouble; - } - else - { - // 64bit integers are not supported - std::ostringstream msg; - msg << "Type of column ["<< colNum << "] \"" << columnName - << "\" is not supported for dynamic queries"; - throw SOCIError(msg.str()); - } - break; - /* case SQL_BLOB: - case SQL_ARRAY:*/ - default: - std::ostringstream msg; - msg << "Type of column ["<< colNum << "] \"" << columnName - << "\" is not supported for dynamic queries"; - throw SOCIError(msg.str()); - break; - } -} - -FirebirdStandardIntoTypeBackEnd * FirebirdStatementBackEnd::makeIntoTypeBackEnd() -{ - return new FirebirdStandardIntoTypeBackEnd(*this); -} - -FirebirdStandardUseTypeBackEnd * FirebirdStatementBackEnd::makeUseTypeBackEnd() -{ - return new FirebirdStandardUseTypeBackEnd(*this); -} - -FirebirdVectorIntoTypeBackEnd * FirebirdStatementBackEnd::makeVectorIntoTypeBackEnd() -{ - return new FirebirdVectorIntoTypeBackEnd(*this); -} - -FirebirdVectorUseTypeBackEnd * FirebirdStatementBackEnd::makeVectorUseTypeBackEnd() -{ - return new FirebirdVectorUseTypeBackEnd(*this); -} diff --git a/src/backends/firebird/test/Makefile.am b/src/backends/firebird/test/Makefile.am deleted file mode 100644 index 8b8d5979..00000000 --- a/src/backends/firebird/test/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/core/test \ - -I$(top_srcdir)/src/backends/firebird - -AM_CPPFLAGS = @FIREBIRD_CFLAGS@ -AM_LDFLAGS = @FIREBIRD_LDFLAGS@ - -noinst_PROGRAMS = \ - test_firebird - -test_firebird_SOURCES = \ - test-firebird.cpp - -test_firebird_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/firebird/lib@SOCI_FIREBIRD_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/firebird/test/Makefile.basic b/src/backends/firebird/test/Makefile.basic deleted file mode 100644 index 14dfeaa5..00000000 --- a/src/backends/firebird/test/Makefile.basic +++ /dev/null @@ -1,22 +0,0 @@ -# The following variable is specific to this backend and its correct -# values might depend on your environment - feel free to set it accordingly. - -FIREBIRDINCLUDEDIR = -I/usr/local/firebird/include -FIREBIRDLIBDIR = -L/usr/local/firebird/lib -FIREBIRDLIBS = -lfbclient -lpthread - -# The rest of the Makefile is indepentent of the target environment. - -COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -INCLUDEDIRS = -I.. -I../../../core ${FIREBIRDINCLUDEDIR} -LIBDIRS = -L.. -L../../../core ${FIREBIRDLIBDIR} -LIBS = -lsoci-core -lsoci-firebird ${FIREBIRDLIBS} - - -test-firebird : test-firebird.cpp - ${COMPILER} -o $@ $? ${CXXFLAGS} ${INCLUDEDIRS} ${LIBDIRS} ${LIBS} - - -clean : - rm -f *.o test-firebird diff --git a/src/backends/firebird/test/Makefile.in b/src/backends/firebird/test/Makefile.in deleted file mode 100644 index 3cb63c5d..00000000 --- a/src/backends/firebird/test/Makefile.in +++ /dev/null @@ -1,484 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -noinst_PROGRAMS = test_firebird$(EXEEXT) -subdir = src/backends/firebird/test -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_test_firebird_OBJECTS = test-firebird.$(OBJEXT) -test_firebird_OBJECTS = $(am_test_firebird_OBJECTS) -test_firebird_DEPENDENCIES = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/firebird/lib@SOCI_FIREBIRD_LIBRARY_NAME@.la -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(test_firebird_SOURCES) -DIST_SOURCES = $(test_firebird_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/core/test \ - -I$(top_srcdir)/src/backends/firebird - -AM_CPPFLAGS = @FIREBIRD_CFLAGS@ -AM_LDFLAGS = @FIREBIRD_LDFLAGS@ -test_firebird_SOURCES = \ - test-firebird.cpp - -test_firebird_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/firebird/lib@SOCI_FIREBIRD_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/firebird/test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/firebird/test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_firebird$(EXEEXT): $(test_firebird_OBJECTS) $(test_firebird_DEPENDENCIES) - @rm -f test_firebird$(EXEEXT) - $(CXXLINK) $(test_firebird_LDFLAGS) $(test_firebird_OBJECTS) $(test_firebird_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-firebird.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/firebird/test/test-firebird.cpp b/src/backends/firebird/test/test-firebird.cpp deleted file mode 100644 index 25ba8212..00000000 --- a/src/backends/firebird/test/test-firebird.cpp +++ /dev/null @@ -1,1194 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// - -#include "soci.h" -#include "soci-firebird.h" -#include "error.h" // SOCI::details::Firebird::throwISCError() -#include "common-tests.h" -#include <iostream> -#include <string> -#include <cassert> -#include <ctime> - -using namespace SOCI; -using namespace SOCI::tests; - - -std::string connectString; -BackEndFactory const &backEnd = firebird; - -// fundamental tests - transactions in Firebird -void test1() -{ - { - Session sql(backEnd, connectString); - - // In Firebird transaction is always required and is started - // automatically when session is opened. There is no need to - // call Session::begin(); it will do nothing if there is active - // transaction. - - // sql.begin(); - - try - { - sql << "drop table test1"; - } - catch (SOCIError const &) - {} // ignore if error - - sql << "create table test1 (id integer)"; - - // After DDL statement transaction must be commited or changes - // won't be visible to active transaction. - sql.commit(); - - // After commit or rollback, transaction must be started manually. - sql.begin(); - - sql << "insert into test1(id) values(5)"; - sql << "drop table test1"; - - // Transaction is automatically commited in Session's destructor - } - - std::cout << "test 1 passed" << std::endl; -} - -// character types -void test2() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop table test2"; - } - catch (SOCIError const &) - {} // ignore if error - - sql << "create table test2 (p1 char(10), p2 varchar(10))"; - sql.commit(); - - sql.begin(); - - { - char a('a'), b('b'), c1, c2; - - sql << "insert into test2(p1,p2) values(?,?)", use(a), use(b); - - sql << "select p1,p2 from test2", into(c1), into(c2); - assert(c1 == 'a' && c2 == 'b'); - - sql << "delete from test2"; - } - - { - char msg[] = "Hello, Firebird!"; - char buf1[100], buf2[100], buf3[100]; - char *b1 = buf1, *b2 = buf2, *b3 = buf3; - - strcpy(b1, msg); - - sql << "insert into test2(p1, p2) values (?,?)", use(b1,100), use(b1,100); - sql << "select p1, p2 from test2", into(b2,100), into(b3,100); - - assert( - buf2[0] == 'H' && buf3[0] == 'H' && - buf2[1] == 'e' && buf3[1] == 'e' && - buf2[2] == 'l' && buf3[2] == 'l' && - buf2[3] == 'l' && buf3[3] == 'l' && - buf2[4] == 'o' && buf3[4] == 'o' && - buf2[5] == ',' && buf3[5] == ',' && - buf2[6] == ' ' && buf3[6] == ' ' && - buf2[7] == 'F' && buf3[7] == 'F' && - buf2[8] == 'i' && buf3[8] == 'i' && - buf2[9] == 'r' && buf3[9] == 'r' && - buf2[10] == '\0' && buf3[10] == '\0'); - - sql << "delete from test2"; - } - - { - char msg[] = "Hello, Firebird!"; - char buf1[100], buf2[100], buf3[100]; - strcpy(buf1, msg); - - sql << "insert into test2(p1, p2) values (?,?)", - use(buf1), use(buf1); - sql << "select p1, p2 from test2", into(buf2), into(buf3); - - assert( - buf2[0] == 'H' && buf3[0] == 'H' && - buf2[1] == 'e' && buf3[1] == 'e' && - buf2[2] == 'l' && buf3[2] == 'l' && - buf2[3] == 'l' && buf3[3] == 'l' && - buf2[4] == 'o' && buf3[4] == 'o' && - buf2[5] == ',' && buf3[5] == ',' && - buf2[6] == ' ' && buf3[6] == ' ' && - buf2[7] == 'F' && buf3[7] == 'F' && - buf2[8] == 'i' && buf3[8] == 'i' && - buf2[9] == 'r' && buf3[9] == 'r' && - buf2[10] == '\0' && buf3[10] == '\0'); - - sql << "delete from test2"; - } - - { - // verify blank padding in CHAR fields - // In Firebird, CHAR fields are always padded with whitespaces. - char msg[] = "Hello"; - sql << "insert into test2(p1) values(\'" << msg << "\')"; - - char buf[20]; - sql << "select p1 from test2", into(buf); - - assert(std::strncmp(buf, msg, 5) == 0); - assert(std::strncmp(buf+5, " ", 5) == 0); - - sql << "delete from test2"; - } - - { - std::string str1("Hello, Firebird!"), str2, str3; - sql << "insert into test2(p1, p2) values (?, ?)", - use(str1), use(str1); - - sql << "select p1, p2 from test2", into(str2), into(str3); - assert(str2 == "Hello, Fir" && str3 == "Hello, Fir"); - - sql << "delete from test2"; - } - - sql << "drop table test2"; - std::cout << "test 2 passed" << std::endl; -} - -// date and time -void test3() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop table test3"; - } - catch (SOCIError const &) - {} // ignore if error - - sql << "create table test3 (p1 timestamp, p2 date, p3 time)"; - sql.commit(); - - sql.begin(); - - std::tm t1, t2, t3; - std::time_t now = std::time(NULL); - std::tm t = *std::localtime(&now); - - sql << "insert into test3(p1, p2, p3) " - << "values (?,?,?)", use(t), use(t), use(t); - - sql << "select p1, p2, p3 from test3", into(t1), into(t2), into(t3); - - // timestamp - assert(t1.tm_year == t.tm_year); - assert(t1.tm_mon == t.tm_mon); - assert(t1.tm_mday == t.tm_mday); - assert(t1.tm_hour == t.tm_hour); - assert(t1.tm_min == t.tm_min); - assert(t1.tm_sec == t.tm_sec); - - // date - assert(t2.tm_year == t.tm_year); - assert(t2.tm_mon == t.tm_mon); - assert(t2.tm_mday == t.tm_mday); - assert(t2.tm_hour == 0); - assert(t2.tm_min == 0); - assert(t2.tm_sec == 0); - - // time - assert(t3.tm_year == 0); - assert(t3.tm_mon == 0); - assert(t3.tm_mday == 0); - assert(t3.tm_hour == t.tm_hour); - assert(t3.tm_min == t.tm_min); - assert(t3.tm_sec == t.tm_sec); - - sql << "drop table test3"; - std::cout << "test 3 passed" << std::endl; -} - -// floating points -void test4() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop table test4"; - } - catch (SOCIError const &) - {} // ignore if error - - sql << "create table test4 (p1 numeric(8,2), " - << "p2 decimal(14,8), p3 double precision, p4 integer)"; - sql.commit(); - - sql.begin(); - - double d1 = 1234.23, d2 = 1e8, d3 = 1.0/1440.0, - d4, d5, d6; - - sql << "insert into test4(p1, p2, p3) values (?,?,?)", - use(d1), use(d2), use(d3); - - sql << "select p1, p2, p3 from test4", - into(d4), into(d5), into(d6); - - assert(d1 == d4 && d2 == d5 && d3 == d6); - - // verify an exception is thrown when fetching non-integral value - // to integral variable - try - { - int i; - sql << "select p1 from test4", into(i); - - // expecting error - assert(false); - } - catch (SOCIError const &e) - { - std::string error = e.what(); - assert(error == - "Can't convert value with scale 2 to integral type"); - } - - // verify an exception is thrown when inserting non-integral value - // to integral column - try - { - sql << "insert into test4(p4) values(?)", use(d1); - - // expecting error - assert(false); - } - catch (SOCIError const &e) - { - std::string error = e.what(); - assert(error == - "Can't convert non-integral value to integral column type"); - } - - sql << "drop table test4"; - std::cout << "test 4 passed" << std::endl; -} - -// integer types and indicators -void test5() -{ - Session sql(backEnd, connectString); - - { - short sh(0); - sql << "select 3 from rdb$database", into(sh); - assert(sh == 3); - } - - { - int i(0); - sql << "select 5 from rdb$database", into(i); - assert(i == 5); - } - - { - unsigned long ul(0); - sql << "select 7 from rdb$database", into(ul); - assert(ul == 7); - } - - { - // test indicators - eIndicator ind; - int i; - - sql << "select 2 from rdb$database", into(i, ind); - assert(ind == eOK); - - sql << "select NULL from rdb$database", into(i, ind); - assert(ind == eNull); - - char buf[4]; - sql << "select \'Hello\' from rdb$database", into(buf, ind); - assert(ind == eTruncated); - - sql << "select 5 from rdb$database where 0 = 1", into(i, ind); - assert(ind == eNoData); - - try - { - // expect error - sql << "select NULL from rdb$database", into(i); - assert(false); - } - catch (SOCIError const &e) - { - std::string error = e.what(); - assert(error == - "Null value fetched and no indicator defined."); - } - - try - { - // expect error - sql << "select 5 from rdb$database where 0 = 1", into(i); - assert(false); - } - catch (SOCIError const &e) - { - std::string error = e.what(); - assert(error == - "No data fetched and no indicator defined."); - } - } - - std::cout << "test 5 passed" << std::endl; -} - -// repeated fetch and bulk operations for character types -void test6() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop table test6"; - } - catch (SOCIError const &) - {} // ignore if error - - sql << "create table test6 (p1 char(10), p2 varchar(10))"; - sql.commit(); - - sql.begin(); - - for (char c = 'a'; c <= 'z'; ++c) - { - sql << "insert into test6(p1, p2) values(?,?)", use(c), use(c); - } - - { - char c='a', c1, c2; - - Statement st = (sql.prepare << - "select p1,p2 from test6 order by p1", into(c1), into(c2)); - - st.execute(); - while (st.fetch()) - { - assert(c == c1 && c == c2); - ++c; - } - assert(c == 'z'+1); - } - - { - char c='a'; - - std::vector<char> c1(10), c2(10); - - Statement st = (sql.prepare << - "select p1,p2 from test6 order by p1", into(c1), into(c2)); - - st.execute(); - while (st.fetch()) - { - for (std::size_t i = 0; i != c1.size(); ++i) - { - assert(c == c1[i] && c == c2[i]); - ++c; - } - } - assert(c == 'z' + 1); - } - - { - // verify an exception is thrown when empty vector is used - std::vector<char> vec; - try - { - sql << "select p1 from test6", into(vec); - assert(false); - } - catch (SOCIError const &e) - { - std::string msg = e.what(); - assert(msg == "Vectors of size 0 are not allowed."); - } - } - - sql << "delete from test6"; - - // verifying std::string - int const rowsToTest = 10; - for (int i = 0; i != rowsToTest; ++i) - { - std::ostringstream ss; - ss << "Hello_" << i; - - std::string const &x = ss.str(); - - sql << "insert into test6(p1, p2) values(\'" - << x << "\', \'" << x << "\')"; - } - - int count; - sql << "select count(*) from test6", into(count); - assert(count == rowsToTest); - - { - int i = 0; - std::string s1, s2; - Statement st = (sql.prepare << - "select p1, p2 from test6 order by p1", into(s1), into(s2)); - - st.execute(); - while (st.fetch()) - { - std::ostringstream ss; - ss << "Hello_" << i; - std::string const &x = ss.str(); - - // Note: CHAR fields are always padded with whitespaces - ss << " "; - assert(s1 == ss.str() && s2 == x); - ++i; - } - assert(i == rowsToTest); - } - - { - int i = 0; - - std::vector<std::string> s1(4), s2(4); - Statement st = (sql.prepare << - "select p1, p2 from test6 order by p1", into(s1), into(s2)); - st.execute(); - while (st.fetch()) - { - for (std::size_t j = 0; j != s1.size(); ++j) - { - std::ostringstream ss; - ss << "Hello_" << i; - std::string const &x = ss.str(); - - // Note: CHAR fields are always padded with whitespaces - ss << " "; - assert(ss.str() == s1[j] && x == s2[j]); - ++i; - } - } - assert(i == rowsToTest); - } - - sql << "drop table test6"; - std::cout << "test 6 passed" << std::endl; -} - -// BLOB test -void test7() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop table test7"; - } - catch (std::runtime_error &) - {} // ignore if error - - sql << "create table test7(id integer, img blob)"; - sql.commit(); - - sql.begin(); - { - // verify empty blob - BLOB b(sql); - eIndicator ind; - - sql << "insert into test7(id, img) values(1,?)", use(b); - sql << "select img from test7 where id = 1", into(b, ind); - - assert(ind == eOK); - assert(b.getLen() == 0); - - sql << "delete from test7"; - } - - { - // create a new blob - BLOB b(sql); - - char str1[] = "Hello"; - b.write(0, str1, strlen(str1)); - - char str2[20]; - std::size_t i = b.read(3,str2,2); - str2[i] = '\0'; - assert(str2[0] == 'l' && str2[1] == 'o' && str2[2] == '\0'); - - char str3[] = ", Firebird!"; - b.append(str3, strlen(str3)); - - sql << "insert into test7(id, img) values(1,?)", use(b); - } - - { - // read & update blob - BLOB b(sql); - - sql << "select img from test7 where id = 1", into(b); - - std::vector<char> text(b.getLen()); - b.read(0, &text[0], b.getLen()); - assert(strncmp(&text[0], "Hello, Firebird!", b.getLen()) == 0); - - char str1[] = "FIREBIRD"; - b.write(7, str1, strlen(str1)); - - // after modification BLOB must be written to database - sql << "update test7 set img=? where id=1", use(b); - } - - { - // read BLOB from database, modify and write to another record - BLOB b(sql); - - sql << "select img from test7 where id = 1", into(b); - - std::vector<char> text(b.getLen()); - b.read(0, &text[0], b.getLen()); - - char str1[] = "HELLO"; - b.write(0,str1, strlen(str1)); - - b.read(0, &text[0], b.getLen()); - assert(strncmp(&text[0], "HELLO, FIREBIRD!", b.getLen()) == 0); - - b.trim(5); - sql << "insert into test7(id, img) values(2,?)", use(b); - } - - { - BLOB b(sql); - Statement st = (sql.prepare << "select img from test7", into(b)); - - st.execute(); - - st.fetch(); - std::vector<char> text(b.getLen()); - b.read(0, &text[0], b.getLen()); - assert(strncmp(&text[0], "Hello, FIREBIRD!", b.getLen()) == 0); - - st.fetch(); - text.resize(b.getLen()); - b.read(0, &text[0], b.getLen()); - assert(strncmp(&text[0], "HELLO", b.getLen()) == 0); - } - - { - // delete BLOB - BLOB b(sql); - eIndicator ind=eNull; - sql << "update test7 set img=? where id = 1", use(b, ind); - - sql << "select img from test7 where id = 2", into(b, ind); - assert(ind==eOK); - - sql << "select img from test7 where id = 1", into(b, ind); - assert(ind==eNull); - } - - sql << "drop table test7"; - std::cout << "test 7 passed" << std::endl; -} - -// named parameters -void test8() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop table test8"; - } - catch (std::runtime_error &) - {} // ignore if error - - sql << "create table test8(id1 integer, id2 integer)"; - sql.commit(); - - sql.begin(); - - int j = 13, k = 4, i, l; - sql << "insert into test8(id1, id2) values(:id1, :id2)", - use(k, "id2"), use(j, "id1"); - sql << "select id1, id2 from test8", into(i), into(l); - assert(i == j && l == k); - - sql << "delete from test8"; - - std::vector<int> in1(3), in2(3); - in1[0] = 3; - in1[1] = 2; - in1[2] = 1; - in2[0] = 4; - in2[1] = 5; - in2[2] = 6; - - { - Statement st = (sql.prepare << - "insert into test8(id1, id2) values(:id1, :id2)", - use(k, "id2"), use(j, "id1")); - - std::size_t s = in1.size(); - for (std::size_t x = 0; x < s; ++x) - { - j = in1[x]; - k = in2[x]; - st.execute(); - } - } - - { - Statement st = ( - sql.prepare << "select id1, id2 from test8", into(i), into(l)); - st.execute(); - - std::size_t x(0); - while (st.fetch()) - { - assert(i = in1[x] && l == in2[x]); - ++x; - } - } - - sql << "delete from test8"; - - // test vectors - sql << "insert into test8(id1, id2) values(:id1, :id2)", - use(in1, "id1"), use(in2, "id2"); - - std::vector<int> out1(3), out2(3); - - sql << "select id1, id2 from test8", into(out1), into(out2); - std::size_t s = out1.size(); - assert(s == 3); - - for (std::size_t x = 0; x<s; ++x) - { - assert(out1[x] == in1[x] && out2[x] == in2[x]); - } - - sql << "drop table test8"; - std::cout << "test 8 passed" << std::endl; -} - -// Dynamic binding to Row objects -void test9() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop table test9"; - } - catch (std::runtime_error &) - {} // ignore if error - - sql << "create table test9(id integer, msg varchar(20), ntest numeric(10,2))"; - sql.commit(); - - sql.begin(); - - { - Row r; - sql << "select * from test9", into(r); - assert(r.indicator(0) == eNoData); - } - - std::string msg("Hello"); - int i(1); - double d(3.14); - eIndicator ind(eOK); - - { - Statement st((sql.prepare << "insert into test9(id, msg, ntest) " - << "values(:id,:msg,:ntest)", - use(i,"id"), use(msg,"msg"), use(d,ind,"ntest"))); - - st.execute(1); - - i = 2; - msg = "Firebird"; - ind = eNull; - st.execute(1); - } - - Row r; - Statement st = (sql.prepare << - "select * from test9", into(r)); - st.execute(1); - - assert(r.size() == 3); - - // get properties by position - assert(r.getProperties(0).getName() == "ID"); - assert(r.getProperties(1).getName() == "MSG"); - assert(r.getProperties(2).getName() == "NTEST"); - - assert(r.getProperties(0).getDataType() == eInteger); - assert(r.getProperties(1).getDataType() == eString); - assert(r.getProperties(2).getDataType() == eDouble); - - // get properties by name - assert(r.getProperties("ID").getName() == "ID"); - assert(r.getProperties("MSG").getName() == "MSG"); - assert(r.getProperties("NTEST").getName() == "NTEST"); - - assert(r.getProperties("ID").getDataType() == eInteger); - assert(r.getProperties("MSG").getDataType() == eString); - assert(r.getProperties("NTEST").getDataType() == eDouble); - - // get values by position - assert(r.get<int>(0) == 1); - assert(r.get<std::string>(1) == "Hello"); - assert(r.get<double>(2) == d); - - // get values by name - assert(r.get<int>("ID") == 1); - assert(r.get<std::string>("MSG") == "Hello"); - assert(r.get<double>("NTEST") == d); - - st.fetch(); - assert(r.get<int>(0) == 2); - assert(r.get<std::string>("MSG") == "Firebird"); - assert(r.indicator(2) == eNull); - - // verify default values - assert(r.get<double>("NTEST", 2) == 2); - bool caught = false; - try - { - double d1 = r.get<double>("NTEST"); - std::cout << d1 << std::endl; // just for compiler - } - catch (SOCIError&) - { - caught = true; - } - assert(caught); - - // verify exception thrown on invalid get<> - caught = false; - try - { - r.get<std::string>(0); - } - catch (std::bad_cast const &) - { - caught = true; - } - assert(caught); - - sql << "drop table test9"; - std::cout << "test 9 passed" << std::endl; -} - -// stored procedures -void test10() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop procedure sp_test10"; - } - catch (std::runtime_error &) - {} // ignore if error - - try - { - sql << "drop procedure sp_test10a"; - } - catch (std::runtime_error &) - {} // ignore if error - - try - { - sql << "drop table test10"; - } - catch (std::runtime_error &) - {} // ignore if error - - sql << "create table test10(id integer, id2 integer)"; - - sql << "create procedure sp_test10\n" - << "returns (rid integer, rid2 integer)\n" - << "as begin\n" - << "for select id, id2 from test10 into rid, rid2 do begin\n" - << "suspend;\n" - << "end\n" - << "end;\n"; - - sql << "create procedure sp_test10a (pid integer, pid2 integer)\n" - << "as begin\n" - << "insert into test10(id, id2) values (:pid, :pid2);\n" - << "end;\n"; - - sql.commit(); - - sql.begin(); - - Row r; - int p1 = 3, p2 = 4; - - // calling procedures that do not return values requires - // 'execute procedure ...' statement - sql << "execute procedure sp_test10a ?, ?", use(p1), use(p2); - - // calling procedures that return values requires - // 'select ... from ...' statement - sql << "select * from sp_test10", into(r); - - assert(r.get<int>(0) == p1 && r.get<int>(1) == p2); - - sql << "delete from test10"; - - p1 = 5; - p2 = 6; - { - Procedure proc = ( - sql.prepare << "sp_test10a :p1, :p2", - use(p2, "p2"), use(p1, "p1")); - proc.execute(1); - } - - { - Row rw; - Procedure proc = (sql.prepare << "sp_test10", into(rw)); - proc.execute(1); - - assert(rw.get<int>(0) == p1 && rw.get<int>(1) == p2); - } - - sql << "delete from test10"; - - // test vectors - std::vector<int> in1(3), in2(3); - in1[0] = 3; - in1[1] = 2; - in1[2] = 1; - in2[0] = 4; - in2[1] = 5; - in2[2] = 6; - - { - Procedure proc = ( - sql.prepare << "sp_test10a :p1, :p2", - use(in2, "p2"), use(in1, "p1")); - proc.execute(1); - } - - { - Row rw; - Procedure proc = (sql.prepare << "sp_test10", into(rw)); - - proc.execute(1); - assert(rw.get<int>(0) == in1[0] && rw.get<int>(1) == in2[0]); - proc.fetch(); - assert(rw.get<int>(0) == in1[1] && rw.get<int>(1) == in2[1]); - proc.fetch(); - assert(rw.get<int>(0) == in1[2] && rw.get<int>(1) == in2[2]); - assert(proc.fetch() == false); - } - - { - std::vector<int> out1(3), out2(3); - Procedure proc = (sql.prepare << "sp_test10", into(out1), into(out2)); - proc.execute(1); - - std::size_t s = out1.size(); - assert(s == 3); - - for (std::size_t x = 0; x < s; ++x) - { - assert(out1[x] == in1[x] && out2[x] == in2[x]); - } - } - - sql.rollback(); - - sql.begin(); - sql << "drop procedure sp_test10"; - sql << "drop procedure sp_test10a"; - sql << "drop table test10"; - - std::cout << "test 10 passed" << std::endl; -} - -// direct access to Firebird using handles exposed by -// SOCI::FirebirdStatmentBackend -namespace SOCI -{ - enum eRowCountType { - eRowsSelected = isc_info_req_select_count, - eRowsInserted = isc_info_req_insert_count, - eRowsUpdated = isc_info_req_update_count, - eRowsDeleted = isc_info_req_delete_count - }; - - // Returns number of rows afected by last statement - // or -1 if there is no such counter available. - long getRowCount(SOCI::Statement & statement, eRowCountType type) - { - ISC_STATUS stat[20]; - char cnt_req[2], cnt_info[128]; - - cnt_req[0]=isc_info_sql_records; - cnt_req[1]=isc_info_end; - - FirebirdStatementBackEnd *statementBackEnd - = static_cast<FirebirdStatementBackEnd *>(statement.getBackEnd()); - - // Note: This is very poorly documented function. - // It can extract number of rows returned by select statement, - // but it appears that this is only number of rows prefetched by - // client library, not total number of selected rows. - if (isc_dsql_sql_info(stat, &statementBackEnd->stmtp_, sizeof(cnt_req), - cnt_req, sizeof(cnt_info), cnt_info)) - { - SOCI::details::Firebird::throwISCError(stat); - } - - long count = -1; - char type_ = static_cast<char>(type); - for (char *ptr = cnt_info + 3; *ptr != isc_info_end;) - { - char count_type = *ptr++; - int l = isc_vax_integer(ptr, 2); - ptr += 2; - count = isc_vax_integer(ptr, l); - - if (count_type == type_) - { - // this is requested number - break; - } - ptr += l; - } - - return count; - } -} // namespace SOCI - -void test11() -{ - Session sql(backEnd, connectString); - - try - { - sql << "drop table test11"; - } - catch (std::runtime_error &) - {} // ignore if error - - sql << "create table test11(id integer)"; - sql.commit(); - - sql.begin(); - - { - std::vector<int> in(3); - in[0] = 3; - in[1] = 2; - in[2] = 1; - - Statement st = (sql.prepare << "insert into test11(id) values(?)", - use(in)); - st.execute(1); - - // Note: Firebird backend inserts every row with separate insert - // statement to achieve the effect of inserting vectors of values. - // Since getRowCount() returns number of rows affected by the *last* - // statement, it will return 1 here. - assert(getRowCount(st, eRowsInserted) == 1); - } - - { - int i = 5; - Statement st = (sql.prepare << "update test11 set id = ? where id<3", - use(i)); - st.execute(1); - assert(getRowCount(st, eRowsUpdated) == 2); - - // verify that no rows were deleted - assert(getRowCount(st, eRowsDeleted) == 0); - } - - { - std::vector<int> out(3); - Statement st = (sql.prepare << "select id from test11", into(out)); - st.execute(1); - - assert(getRowCount(st, eRowsSelected) == 3); - } - - { - Statement st = (sql.prepare << "delete from test11 where id=10"); - st.execute(1); - assert(getRowCount(st, eRowsDeleted) == 0); - } - - { - Statement st = (sql.prepare << "delete from test11"); - st.execute(1); - assert(getRowCount(st, eRowsDeleted) == 3); - } - - sql << "drop table test11"; - std::cout << "test 11 passed" << std::endl; -} - -// -// Support for SOCI Common Tests -// - -struct TableCreator1 : public TableCreatorBase -{ - TableCreator1(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(id integer, val integer, c char, " - "str varchar(20), sh smallint, ul decimal(9,0), d double precision, " - "tm timestamp, i1 integer, i2 integer, i3 integer, name varchar(20))"; - session.commit(); - session.begin(); - } -}; - -struct TableCreator2 : public TableCreatorBase -{ - TableCreator2(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(\"num_float\" float, \"num_int\" integer, " - "\"name\" varchar(20), \"sometime\" timestamp, \"chr\" char)"; - session.commit(); - session.begin(); - } -}; - -struct TableCreator3 : public TableCreatorBase -{ - TableCreator3(Session& session) - : TableCreatorBase(session) - { - // CommonTest uses lower-case column names, - // so we need to enforce such names here. - // That's why column names are enclosed in "" - session << "create table soci_test(\"name\" varchar(100) not null, " - "\"phone\" varchar(15))"; - session.commit(); - session.begin(); - } -}; - -class TestContext :public TestContextBase -{ - public: - TestContext(BackEndFactory const &backEnd, - std::string const &connectString) - : TestContextBase(backEnd, connectString) - {} - - TableCreatorBase* tableCreator1(Session& s) const - { - return new TableCreator1(s); - } - - TableCreatorBase* tableCreator2(Session& s) const - { - return new TableCreator2(s); - } - - TableCreatorBase* tableCreator3(Session& s) const - { - return new TableCreator3(s); - } - - std::string toDateTime(std::string const &dateString) const - { - return "'" + dateString + "'"; - } -}; - - -int main(int argc, char** argv) -{ - -#ifdef _MSC_VER - // Redirect errors, unrecoverable problems, and assert() failures to STDERR, - // instead of debug message window. - // This hack is required to run asser()-driven tests by Buildbot. - // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside. - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); -#endif //_MSC_VER - - if (argc == 2) - { - connectString = argv[1]; - } - else - { - std::ostringstream msg; - msg << "usage: " << argv[0] - << " connectstring\n" - << "example: " << argv[0] - << " \"service=/usr/local/firebird/db/test.fdb user=SYSDBA password=masterkey\"\n"; - - std::cout << msg.str().c_str(); - exit(1); - } - - try - { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); - tests.run(); - - test1(); - test2(); - test3(); - test4(); - test5(); - test6(); - test7(); - test8(); - test9(); - test10(); - test11(); - - std::cout << "\nOK, all tests passed.\n\n"; - } - catch (std::exception const & e) - { - std::cout << e.what() << '\n'; - } -} diff --git a/src/backends/firebird/vector-into-type.cpp b/src/backends/firebird/vector-into-type.cpp deleted file mode 100644 index bc69aaa8..00000000 --- a/src/backends/firebird/vector-into-type.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" -#include "common.h" - -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Firebird; - -void FirebirdVectorIntoTypeBackEnd::defineByPos( - int & position, void * data, eExchangeType type) -{ - position_ = position-1; - data_ = data; - type_ = type; - - ++position; - - statement_.intoType_ = eVector; - statement_.intos_.push_back(static_cast<void*>(this)); - - XSQLVAR *var = statement_.sqldap_->sqlvar+position_; - - buf_ = allocBuffer(var); - var->sqldata = buf_; - var->sqlind = &indISCHolder_; -} - -void FirebirdVectorIntoTypeBackEnd::preFetch() -{ - // Nothing to do here. -} - -namespace // anonymous -{ - template <typename T> - void setIntoVector(void *p, std::size_t indx, T const &val) - { - std::vector<T> *dest = - static_cast<std::vector<T> *>(p); - - std::vector<T> &v = *dest; - v[indx] = val; - } -} // namespace anonymous - -// this will exchange data with vector user buffers -void FirebirdVectorIntoTypeBackEnd::exchangeData(std::size_t row) -{ - XSQLVAR *var = statement_.sqldap_->sqlvar+position_; - - switch (type_) - { - // simple cases - case eXChar: - setIntoVector(data_, row, getTextParam(var)[0]); - break; - case eXShort: - { - short tmp = from_isc<short>(var); - setIntoVector(data_, row, tmp); - } - break; - case eXInteger: - { - int tmp = from_isc<int>(var); - setIntoVector(data_, row, tmp); - } - break; - case eXUnsignedLong: - { - unsigned long tmp = from_isc<unsigned long>(var); - setIntoVector(data_, row, tmp); - } - break; - case eXDouble: - { - double tmp = from_isc<double>(var); - setIntoVector(data_, row, tmp); - } - break; - - // cases that require adjustments and buffer management - case eXStdString: - setIntoVector(data_, row, getTextParam(var)); - break; - case eXStdTm: - { - std::tm data; - tmDecode(var->sqltype, buf_, &data); - setIntoVector(data_, row, data); - } - break; - - default: - throw SOCIError("Into vector element used with non-supported type."); - } // switch - -} - -void FirebirdVectorIntoTypeBackEnd::postFetch( - bool gotData, eIndicator * ind) -{ - // Here we have to set indicators only. Data was exchanged with user - // buffers during fetch() - if (gotData) - { - std::size_t rows = statement_.inds_[0].size(); - - for (std::size_t i = 0; i<rows; ++i) - { - if (statement_.inds_[position_][i] == eNull && !ind) - { - throw SOCIError("Null value fetched and no indicator defined."); - } - else if (ind != NULL) - { - ind[i] = statement_.inds_[position_][i]; - } - } - } -} - -void FirebirdVectorIntoTypeBackEnd::resize(std::size_t sz) -{ - switch (type_) - { - case eXChar: - resizeVector<char> (data_, sz); - break; - case eXShort: - resizeVector<short> (data_, sz); - break; - case eXInteger: - resizeVector<int> (data_, sz); - break; - case eXUnsignedLong: - resizeVector<unsigned long>(data_, sz); - break; - case eXDouble: - resizeVector<double> (data_, sz); - break; - case eXStdString: - resizeVector<std::string> (data_, sz); - break; - case eXStdTm: - resizeVector<std::tm> (data_, sz); - break; - - default: - throw SOCIError("Into vector element used with non-supported type."); - } -} - -std::size_t FirebirdVectorIntoTypeBackEnd::size() -{ - std::size_t sz = 0; // dummy initialization to please the compiler - switch (type_) - { - // simple cases - case eXChar: - sz = getVectorSize<char> (data_); - break; - case eXShort: - sz = getVectorSize<short> (data_); - break; - case eXInteger: - sz = getVectorSize<int> (data_); - break; - case eXUnsignedLong: - sz = getVectorSize<unsigned long>(data_); - break; - case eXDouble: - sz = getVectorSize<double> (data_); - break; - case eXStdString: - sz = getVectorSize<std::string> (data_); - break; - case eXStdTm: - sz = getVectorSize<std::tm> (data_); - break; - - default: - throw SOCIError("Into vector element used with non-supported type."); - } - - return sz; -} - -void FirebirdVectorIntoTypeBackEnd::cleanUp() -{ - if (buf_ != NULL) - { - delete[] buf_; - buf_ = NULL; - } -} diff --git a/src/backends/firebird/vector-use-type.cpp b/src/backends/firebird/vector-use-type.cpp deleted file mode 100644 index 3080c068..00000000 --- a/src/backends/firebird/vector-use-type.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, Rafal Bobrowski -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_FIREBIRD_SOURCE -#include "soci-firebird.h" -#include "common.h" - -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Firebird; - -void FirebirdVectorUseTypeBackEnd::bindByPos(int & position, - void * data, eExchangeType type) -{ - if (statement_.boundByName_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - position_ = position-1; - data_ = data; - type_ = type; - - ++position; - - statement_.useType_ = eVector; - statement_.uses_.push_back(static_cast<void*>(this)); - - XSQLVAR *var = statement_.sqlda2p_->sqlvar+position_; - - buf_ = allocBuffer(var); - var->sqldata = buf_; - var->sqlind = &indISCHolder_; - - statement_.boundByPos_ = true; -} - -void FirebirdVectorUseTypeBackEnd::bindByName( - std::string const & name, void * data, eExchangeType type) -{ - if (statement_.boundByPos_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - std::map <std::string, int> :: iterator idx = - statement_.names_.find(name); - - if (idx == statement_.names_.end()) - { - throw SOCIError("Missing use element for bind by name (" + name + ")"); - } - - position_ = idx->second; - data_ = data; - type_ = type; - - statement_.useType_ = eVector; - statement_.uses_.push_back(static_cast<void*>(this)); - - XSQLVAR *var = statement_.sqlda2p_->sqlvar+position_; - - buf_ = allocBuffer(var); - var->sqldata = buf_; - var->sqlind = &indISCHolder_; - - statement_.boundByName_ = true; -} - -void FirebirdVectorUseTypeBackEnd::preUse(eIndicator const * ind) -{ - inds_ = ind; -} - -namespace -{ - template <typename T> - T* getUseVectorValue(void *v, std::size_t index) - { - std::vector<T> *src = - static_cast<std::vector<T> *>(v); - - std::vector<T> &v_ = *src; - return &(v_[index]); - } -} - -void FirebirdVectorUseTypeBackEnd::exchangeData(std::size_t row) -{ - // first prepare indicators - if (inds_ != NULL) - { - switch (inds_[row]) - { - case eNull: - indISCHolder_ = -1; - break; - case eOK: - indISCHolder_ = 0; - break; - default: - throw SOCIError("Use element used with non-supported indicator type."); - } - } - - XSQLVAR * var = statement_.sqlda2p_->sqlvar+position_; - - // then set parameters for query execution - switch (type_) - { - // simple cases - case eXChar: - setTextParam(getUseVectorValue<char>(data_, row), 1, buf_, var); - break; - case eXShort: - to_isc<short>( - static_cast<void*>(getUseVectorValue<short>(data_, row)), - var); - break; - case eXInteger: - to_isc<int>( - static_cast<void*>(getUseVectorValue<int>(data_, row)), - var); - break; - case eXUnsignedLong: - to_isc<unsigned long>( - static_cast<void*>(getUseVectorValue<unsigned long>(data_, row)), - var); - break; - case eXDouble: - to_isc<double>( - static_cast<void*>(getUseVectorValue<double>(data_, row)), - var); - break; - - // cases that require adjustments and buffer management - case eXStdString: - { - std::string *tmp = getUseVectorValue<std::string>(data_, row); - setTextParam(tmp->c_str(), tmp->size(), buf_, var); - } - break; - case eXStdTm: - tmEncode(var->sqltype, - getUseVectorValue<std::tm>(data_, row), buf_); - break; -// Not supported -// case eXCString: -// case eXBLOB: - default: - throw SOCIError("Use element used with non-supported type."); - } // switch -} - -std::size_t FirebirdVectorUseTypeBackEnd::size() -{ - std::size_t sz = 0; // dummy initialization to please the compiler - switch (type_) - { - // simple cases - case eXChar: - sz = getVectorSize<char> (data_); - break; - case eXShort: - sz = getVectorSize<short> (data_); - break; - case eXInteger: - sz = getVectorSize<int> (data_); - break; - case eXUnsignedLong: - sz = getVectorSize<unsigned long>(data_); - break; - case eXDouble: - sz = getVectorSize<double> (data_); - break; - case eXStdString: - sz = getVectorSize<std::string> (data_); - break; - case eXStdTm: - sz = getVectorSize<std::tm> (data_); - break; - - default: - throw SOCIError("Use vector element used with non-supported type."); - } - - return sz; -} - -void FirebirdVectorUseTypeBackEnd::cleanUp() -{ - if (buf_ != NULL) - { - delete[] buf_; - buf_ = NULL; - } -} diff --git a/src/backends/mysql/Makefile.am b/src/backends/mysql/Makefile.am deleted file mode 100644 index 276e2ec1..00000000 --- a/src/backends/mysql/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @MYSQL_CFLAGS@ -AM_LDFLAGS = @MYSQL_LDFLAGS@ - -lib_LTLIBRARIES = \ - lib@SOCI_MYSQL_LIBRARY_NAME@.la - -lib@SOCI_MYSQL_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_MYSQL_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - common.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_mysqldir = $(includedir)/soci/mysql - -soci_mysql_HEADERS = \ - common.h \ - soci-mysql.h - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/mysql/Makefile.basic b/src/backends/mysql/Makefile.basic index ed817988..0073fadd 100644 --- a/src/backends/mysql/Makefile.basic +++ b/src/backends/mysql/Makefile.basic @@ -23,7 +23,7 @@ OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ vector-into-type-s.o vector-use-type-s.o common-s.o -libsoci-mysql.a : ${OBJECTS} +libsoci_mysql.a : ${OBJECTS} ar rv $@ $? rm *.o @@ -59,7 +59,7 @@ vector-use-type.o : vector-use-type.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci-mysql.so ${OBJECTSSO} + ${COMPILER} -shared -o libsoci_mysql.so ${OBJECTSSO} rm *.o blob-s.o : blob.cpp @@ -94,4 +94,4 @@ vector-use-type-s.o : vector-use-type.cpp clean : - rm -f libsoci-mysql.a libsoci-mysql.so + rm -f libsoci_mysql.a libsoci_mysql.so diff --git a/src/backends/mysql/Makefile.in b/src/backends/mysql/Makefile.in deleted file mode 100644 index 7d0c2bd6..00000000 --- a/src/backends/mysql/Makefile.in +++ /dev/null @@ -1,561 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends/mysql -DIST_COMMON = $(soci_mysql_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soci_mysqldir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -lib@SOCI_MYSQL_LIBRARY_NAME@_la_LIBADD = -am_lib@SOCI_MYSQL_LIBRARY_NAME@_la_OBJECTS = blob.lo common.lo \ - factory.lo row-id.lo session.lo standard-into-type.lo \ - standard-use-type.lo statement.lo vector-into-type.lo \ - vector-use-type.lo -lib@SOCI_MYSQL_LIBRARY_NAME@_la_OBJECTS = \ - $(am_lib@SOCI_MYSQL_LIBRARY_NAME@_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib@SOCI_MYSQL_LIBRARY_NAME@_la_SOURCES) -DIST_SOURCES = $(lib@SOCI_MYSQL_LIBRARY_NAME@_la_SOURCES) -soci_mysqlHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(soci_mysql_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @MYSQL_CFLAGS@ -AM_LDFLAGS = @MYSQL_LDFLAGS@ -lib_LTLIBRARIES = \ - lib@SOCI_MYSQL_LIBRARY_NAME@.la - -lib@SOCI_MYSQL_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_MYSQL_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - common.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_mysqldir = $(includedir)/soci/mysql -soci_mysql_HEADERS = \ - common.h \ - soci-mysql.h - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/mysql/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/mysql/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -lib@SOCI_MYSQL_LIBRARY_NAME@.la: $(lib@SOCI_MYSQL_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_MYSQL_LIBRARY_NAME@_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(lib@SOCI_MYSQL_LIBRARY_NAME@_la_LDFLAGS) $(lib@SOCI_MYSQL_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_MYSQL_LIBRARY_NAME@_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blob.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/row-id.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-use-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-use-type.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-soci_mysqlHEADERS: $(soci_mysql_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(soci_mysqldir)" || $(mkdir_p) "$(DESTDIR)$(soci_mysqldir)" - @list='$(soci_mysql_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(soci_mysqlHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(soci_mysqldir)/$$f'"; \ - $(soci_mysqlHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(soci_mysqldir)/$$f"; \ - done - -uninstall-soci_mysqlHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(soci_mysql_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(soci_mysqldir)/$$f'"; \ - rm -f "$(DESTDIR)$(soci_mysqldir)/$$f"; \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soci_mysqldir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-soci_mysqlHEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-soci_mysqlHEADERS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-soci_mysqlHEADERS \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-libLTLIBRARIES uninstall-soci_mysqlHEADERS - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/mysql/blob.cpp b/src/backends/mysql/blob.cpp index e9f3ff39..b18444dd 100644 --- a/src/backends/mysql/blob.cpp +++ b/src/backends/mysql/blob.cpp @@ -8,54 +8,52 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" -#include <soci.h> #include <ciso646> #ifdef _MSC_VER #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; -MySQLBLOBBackEnd::MySQLBLOBBackEnd(MySQLSessionBackEnd &session) +mysql_blob_backend::mysql_blob_backend(mysql_session_backend &session) : session_(session) { - throw SOCIError("BLOBs are not supported."); + throw soci_error("BLOBs are not supported."); } -MySQLBLOBBackEnd::~MySQLBLOBBackEnd() +mysql_blob_backend::~mysql_blob_backend() { - throw SOCIError("BLOBs are not supported."); + throw soci_error("BLOBs are not supported."); } -std::size_t MySQLBLOBBackEnd::getLen() +std::size_t mysql_blob_backend::get_len() { - throw SOCIError("BLOBs are not supported."); + throw soci_error("BLOBs are not supported."); } -std::size_t MySQLBLOBBackEnd::read( +std::size_t mysql_blob_backend::read( std::size_t /* offset */, char * /* buf */, std::size_t /* toRead */) { - throw SOCIError("BLOBs are not supported."); + throw soci_error("BLOBs are not supported."); } -std::size_t MySQLBLOBBackEnd::write( +std::size_t mysql_blob_backend::write( std::size_t /* offset */, char const * /* buf */, std::size_t /* toWrite */) { - throw SOCIError("BLOBs are not supported."); + throw soci_error("BLOBs are not supported."); } -std::size_t MySQLBLOBBackEnd::append( +std::size_t mysql_blob_backend::append( char const * /* buf */, std::size_t /* toWrite */) { - throw SOCIError("BLOBs are not supported."); + throw soci_error("BLOBs are not supported."); } -void MySQLBLOBBackEnd::trim(std::size_t /* newLen */) +void mysql_blob_backend::trim(std::size_t /* newLen */) { - throw SOCIError("BLOBs are not supported."); + throw soci_error("BLOBs are not supported."); } - diff --git a/src/backends/mysql/common.cpp b/src/backends/mysql/common.cpp index 297cab6b..acffb0fe 100644 --- a/src/backends/mysql/common.cpp +++ b/src/backends/mysql/common.cpp @@ -15,7 +15,7 @@ namespace // anonymous { // helper function for parsing decimal data (for std::tm) -long parse10(char const *&p1, char *&p2, char *msg) +long parse10(char const *&p1, char *&p2, const char *msg) { long v = std::strtol(p1, &p2, 10); if (p2 != p1) @@ -25,21 +25,21 @@ long parse10(char const *&p1, char *&p2, char *msg) } else { - throw SOCI::SOCIError(msg); + throw soci::soci_error(msg); } } } // namespace anonymous -void SOCI::details::MySQL::parseStdTm(char const *buf, std::tm &t) +void soci::details::mysql::parse_std_tm(char const *buf, std::tm &t) { char const *p1 = buf; char *p2; long year, month, day; long hour = 0, minute = 0, second = 0; - char *errMsg = "Cannot convert data to std::tm."; + const char *errMsg = "Cannot convert data to std::tm."; year = parse10(p1, p2, errMsg); month = parse10(p1, p2, errMsg); @@ -64,14 +64,13 @@ void SOCI::details::MySQL::parseStdTm(char const *buf, std::tm &t) std::mktime(&t); } -char * SOCI::details::MySQL::quote(MYSQL * conn, const char *s, int l) +char * soci::details::mysql::quote(MYSQL * conn, const char *s, int len) { - char *retv = new char[2 * l + 3]; + char *retv = new char[2 * len + 3]; retv[0] = '\''; - int le = mysql_real_escape_string(conn, retv + 1, s, l); - retv[le + 1] = '\''; - retv[le + 2] = '\0'; + int len_esc = mysql_real_escape_string(conn, retv + 1, s, len); + retv[len_esc + 1] = '\''; + retv[len_esc + 2] = '\0'; return retv; } - diff --git a/src/backends/mysql/common.h b/src/backends/mysql/common.h index cc9d7b0d..7b6a96b9 100644 --- a/src/backends/mysql/common.h +++ b/src/backends/mysql/common.h @@ -5,36 +5,50 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef MYSQL_COMMON_H_INCLUDED -#define MYSQL_COMMON_H_INCLUDED +#ifndef SOCI_MYSQL_COMMON_H_INCLUDED +#define SOCI_MYSQL_COMMON_H_INCLUDED +#include <sstream> #include "soci-mysql.h" -namespace SOCI { +namespace soci +{ -namespace details { +namespace details +{ -namespace MySQL { +namespace mysql +{ // helper function for parsing datetime values -void parseStdTm(char const *buf, std::tm &t); +void parse_std_tm(char const *buf, std::tm &t); + +template <typename T> +void parse_num(char const *buf, T &x) +{ + std::istringstream iss(buf); + iss >> x; + if (iss.fail() || (iss.eof() == false)) + { + throw soci_error("Cannot convert data."); + } +} // helper for escaping strings -char * quote(MYSQL * conn, const char *s, int l); +char * quote(MYSQL * conn, const char *s, int len); // helper for vector operations template <typename T> -std::size_t getVectorSize(void *p) +std::size_t get_vector_size(void *p) { std::vector<T> *v = static_cast<std::vector<T> *>(p); return v->size(); } -} // namespace MySQL +} // namespace mysql } // namespace details -} // namespace SOCI - -#endif // MYSQL_COMMON_H_INCLUDED +} // namespace soci +#endif // SOCI_MYSQL_COMMON_H_INCLUDED diff --git a/src/backends/mysql/factory.cpp b/src/backends/mysql/factory.cpp index 863deacd..2f01e569 100644 --- a/src/backends/mysql/factory.cpp +++ b/src/backends/mysql/factory.cpp @@ -8,22 +8,32 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" -#include <soci.h> #include <ciso646> #ifdef _MSC_VER #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; // concrete factory for MySQL concrete strategies -MySQLSessionBackEnd * MySQLBackEndFactory::makeSession( +mysql_session_backend * mysql_backend_factory::make_session( std::string const &connectString) const { - return new MySQLSessionBackEnd(connectString); + return new mysql_session_backend(connectString); } -MySQLBackEndFactory const SOCI::mysql; +mysql_backend_factory const soci::mysql; + +extern "C" +{ + +// for dynamic backend loading +SOCI_MYSQL_DECL backend_factory const * factory_mysql() +{ + return &soci::mysql; +} + +} // extern "C" diff --git a/src/backends/mysql/row-id.cpp b/src/backends/mysql/row-id.cpp index 5e053050..149eda9d 100644 --- a/src/backends/mysql/row-id.cpp +++ b/src/backends/mysql/row-id.cpp @@ -8,23 +8,23 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" -#include <soci.h> #include <ciso646> #ifdef _MSC_VER #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; -MySQLRowIDBackEnd::MySQLRowIDBackEnd(MySQLSessionBackEnd & /* session */) +mysql_rowid_backend::mysql_rowid_backend( + mysql_session_backend & /* session */) { - throw SOCIError("RowIDs are not supported."); + throw soci_error("RowIDs are not supported."); } -MySQLRowIDBackEnd::~MySQLRowIDBackEnd() +mysql_rowid_backend::~mysql_rowid_backend() { - throw SOCIError("RowIDs are not supported."); + throw soci_error("RowIDs are not supported."); } diff --git a/src/backends/mysql/session.cpp b/src/backends/mysql/session.cpp index 9b4b3b40..b17ecb21 100644 --- a/src/backends/mysql/session.cpp +++ b/src/backends/mysql/session.cpp @@ -8,7 +8,6 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" -#include <soci.h> #include <cctype> #include <cerrno> #include <ciso646> @@ -18,14 +17,15 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; using std::string; -namespace { // anonymous +namespace +{ // anonymous -void skipWhite(string::const_iterator *i, +void skip_white(string::const_iterator *i, string::const_iterator const & end, bool endok) { for (;;) @@ -38,7 +38,7 @@ void skipWhite(string::const_iterator *i, } else { - throw SOCIError("Unexpected end of connection string."); + throw soci_error("Unexpected end of connection string."); } } if (std::isspace(**i)) @@ -52,13 +52,13 @@ void skipWhite(string::const_iterator *i, } } -string paramName(string::const_iterator *i, +string param_name(string::const_iterator *i, string::const_iterator const & end) { string val(""); for (;;) { - if (*i == end or (!std::isalpha(**i) and **i != '_')) + if (*i == end or (not std::isalpha(**i) and **i != '_')) { break; } @@ -68,7 +68,7 @@ string paramName(string::const_iterator *i, return val; } -string paramValue(string::const_iterator *i, +string param_value(string::const_iterator *i, string::const_iterator const & end) { string err = "Malformed connection string."; @@ -89,7 +89,7 @@ string paramValue(string::const_iterator *i, { if (quot) { - throw SOCIError(err); + throw soci_error(err); } else { @@ -105,10 +105,10 @@ string paramValue(string::const_iterator *i, } else { - throw SOCIError(err); + throw soci_error(err); } } - if (!quot and std::isspace(**i)) + if (not quot and std::isspace(**i)) { break; } @@ -117,7 +117,7 @@ string paramValue(string::const_iterator *i, ++*i; if (*i == end) { - throw SOCIError(err); + throw soci_error(err); } } val += **i; @@ -126,13 +126,13 @@ string paramValue(string::const_iterator *i, return val; } -bool validInt(const string & s) +bool valid_int(const string & s) { char *tail; const char *cstr = s.c_str(); errno = 0; - long l = std::strtol(cstr, &tail, 10); - if (errno != 0 or l > INT_MAX or l < INT_MIN) + long n = std::strtol(cstr, &tail, 10); + if (errno != 0 or n > INT_MAX or n < INT_MIN) { return false; } @@ -143,7 +143,7 @@ bool validInt(const string & s) return true; } -void parseConnectString(const string & connectString, +void parse_connect_string(const string & connectString, string *host, bool *host_p, string *user, bool *user_p, string *password, bool *password_p, @@ -162,133 +162,136 @@ void parseConnectString(const string & connectString, end = connectString.end(); while (i != end) { - skipWhite(&i, end, true); + skip_white(&i, end, true); if (i == end) { return; } - string par = paramName(&i, end); - skipWhite(&i, end, false); + string par = param_name(&i, end); + skip_white(&i, end, false); if (*i == '=') { ++i; } else { - throw SOCIError(err); + throw soci_error(err); } - skipWhite(&i, end, false); - string val = paramValue(&i, end); - if (par == "port" and !*port_p) + skip_white(&i, end, false); + string val = param_value(&i, end); + if (par == "port" and not *port_p) { - if (!validInt(val)) + if (not valid_int(val)) { - throw SOCIError(err); + throw soci_error(err); } *port = std::atoi(val.c_str()); if (port < 0) { - throw SOCIError(err); + throw soci_error(err); } *port_p = true; } - else if (par == "host" and !*host_p) + else if (par == "host" and not *host_p) { *host = val; *host_p = true; } - else if (par == "user" and !*user_p) + else if (par == "user" and not *user_p) { *user = val; *user_p = true; } - else if ((par == "pass" or par == "password") and !*password_p) + else if ((par == "pass" or par == "password") and not *password_p) { *password = val; *password_p = true; } - else if ((par == "db" or par == "dbname") and !*db_p) + else if ((par == "db" or par == "dbname") and not *db_p) { *db = val; *db_p = true; } - else if (par == "unix_socket" && !*unix_socket_p) + else if (par == "unix_socket" and not *unix_socket_p) { *unix_socket = val; *unix_socket_p = true; } else { - throw SOCIError(err); + throw soci_error(err); } } } } // namespace anonymous -MySQLSessionBackEnd::MySQLSessionBackEnd( +mysql_session_backend::mysql_session_backend( std::string const & connectString) { string host, user, password, db, unix_socket; int port; bool host_p, user_p, password_p, db_p, unix_socket_p, port_p; - parseConnectString(connectString, &host, &host_p, &user, &user_p, + parse_connect_string(connectString, &host, &host_p, &user, &user_p, &password, &password_p, &db, &db_p, &unix_socket, &unix_socket_p, &port, &port_p); conn_ = mysql_init(NULL); if (conn_ == NULL) { - throw SOCIError("mysql_init() failed."); + throw soci_error("mysql_init() failed."); } - if (!mysql_real_connect(conn_, + if (mysql_real_connect(conn_, host_p ? host.c_str() : NULL, user_p ? user.c_str() : NULL, password_p ? password.c_str() : NULL, db_p ? db.c_str() : NULL, port_p ? port : 0, unix_socket_p ? unix_socket.c_str() : NULL, - 0)) { - string err = mysql_error(conn_); - cleanUp(); - throw SOCIError(err); + 0) == NULL) + { + string errMsg = mysql_error(conn_); + unsigned int errNum = mysql_errno(conn_); + clean_up(); + throw mysql_soci_error(errMsg, errNum); } } -MySQLSessionBackEnd::~MySQLSessionBackEnd() +mysql_session_backend::~mysql_session_backend() { - cleanUp(); + clean_up(); } -namespace { // anonymous +namespace // unnamed +{ // helper function for hardcoded queries -void hardExec(MYSQL *conn, const string & query) +void hard_exec(MYSQL *conn, const string & query) { - //cerr << query << endl; - if (0 != mysql_real_query(conn, query.c_str(), static_cast<unsigned long>(query.size()))) + if (0 != mysql_real_query(conn, query.c_str(), + static_cast<unsigned long>(query.size()))) { - throw SOCIError(mysql_error(conn)); + throw soci_error(mysql_error(conn)); } } -} // namespace anonymous +} // namespace unnamed -void MySQLSessionBackEnd::begin() +void mysql_session_backend::begin() { - hardExec(conn_, "BEGIN"); + hard_exec(conn_, "BEGIN"); } -void MySQLSessionBackEnd::commit() +void mysql_session_backend::commit() { - hardExec(conn_, "COMMIT"); + hard_exec(conn_, "COMMIT"); } -void MySQLSessionBackEnd::rollback() +void mysql_session_backend::rollback() { - hardExec(conn_, "ROLLBACK"); + hard_exec(conn_, "ROLLBACK"); } -void MySQLSessionBackEnd::cleanUp() +void mysql_session_backend::clean_up() { if (conn_ != NULL) { @@ -297,18 +300,17 @@ void MySQLSessionBackEnd::cleanUp() } } -MySQLStatementBackEnd * MySQLSessionBackEnd::makeStatementBackEnd() +mysql_statement_backend * mysql_session_backend::make_statement_backend() { - return new MySQLStatementBackEnd(*this); + return new mysql_statement_backend(*this); } -MySQLRowIDBackEnd * MySQLSessionBackEnd::makeRowIDBackEnd() +mysql_rowid_backend * mysql_session_backend::make_rowid_backend() { - return new MySQLRowIDBackEnd(*this); + return new mysql_rowid_backend(*this); } -MySQLBLOBBackEnd * MySQLSessionBackEnd::makeBLOBBackEnd() +mysql_blob_backend * mysql_session_backend::make_blob_backend() { - return new MySQLBLOBBackEnd(*this); + return new mysql_blob_backend(*this); } - diff --git a/src/backends/mysql/soci-mysql.h b/src/backends/mysql/soci-mysql.h index c8b3b1cd..275646a8 100644 --- a/src/backends/mysql/soci-mysql.h +++ b/src/backends/mysql/soci-mysql.h @@ -32,130 +32,139 @@ #include <vector> -namespace SOCI +namespace soci { -struct MySQLStatementBackEnd; -struct MySQLStandardIntoTypeBackEnd : details::StandardIntoTypeBackEnd +class mysql_soci_error : public soci_error { - MySQLStandardIntoTypeBackEnd(MySQLStatementBackEnd &st) +public: + mysql_soci_error(std::string const & msg, int errNum) + : soci_error(msg), err_num_(errNum) {} + + unsigned int err_num_; +}; + +struct mysql_statement_backend; +struct mysql_standard_into_type_backend : details::standard_into_type_backend +{ + mysql_standard_into_type_backend(mysql_statement_backend &st) : statement_(st) {} - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); + virtual void define_by_pos(int &position, + void *data, details::exchange_type type); - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind); + virtual void pre_fetch(); + virtual void post_fetch(bool gotData, bool calledFromFetch, + indicator *ind); - virtual void cleanUp(); + virtual void clean_up(); - MySQLStatementBackEnd &statement_; + mysql_statement_backend &statement_; void *data_; - details::eExchangeType type_; + details::exchange_type type_; int position_; }; -struct MySQLVectorIntoTypeBackEnd : details::VectorIntoTypeBackEnd +struct mysql_vector_into_type_backend : details::vector_into_type_backend { - MySQLVectorIntoTypeBackEnd(MySQLStatementBackEnd &st) + mysql_vector_into_type_backend(mysql_statement_backend &st) : statement_(st) {} - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); + virtual void define_by_pos(int &position, + void *data, details::exchange_type type); - virtual void preFetch(); - virtual void postFetch(bool gotData, eIndicator *ind); + virtual void pre_fetch(); + virtual void post_fetch(bool gotData, indicator *ind); virtual void resize(std::size_t sz); virtual std::size_t size(); - virtual void cleanUp(); + virtual void clean_up(); - MySQLStatementBackEnd &statement_; + mysql_statement_backend &statement_; void *data_; - details::eExchangeType type_; + details::exchange_type type_; int position_; }; -struct MySQLStandardUseTypeBackEnd : details::StandardUseTypeBackEnd +struct mysql_standard_use_type_backend : details::standard_use_type_backend { - MySQLStandardUseTypeBackEnd(MySQLStatementBackEnd &st) + mysql_standard_use_type_backend(mysql_statement_backend &st) : statement_(st), position_(0), buf_(NULL) {} - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); + virtual void bind_by_pos(int &position, + void *data, details::exchange_type type, bool readOnly); + virtual void bind_by_name(std::string const &name, + void *data, details::exchange_type type, bool readOnly); - virtual void preUse(eIndicator const *ind); - virtual void postUse(bool gotData, eIndicator *ind); + virtual void pre_use(indicator const *ind); + virtual void post_use(bool gotData, indicator *ind); - virtual void cleanUp(); + virtual void clean_up(); - MySQLStatementBackEnd &statement_; + mysql_statement_backend &statement_; void *data_; - details::eExchangeType type_; + details::exchange_type type_; int position_; std::string name_; char *buf_; }; -struct MySQLVectorUseTypeBackEnd : details::VectorUseTypeBackEnd +struct mysql_vector_use_type_backend : details::vector_use_type_backend { - MySQLVectorUseTypeBackEnd(MySQLStatementBackEnd &st) + mysql_vector_use_type_backend(mysql_statement_backend &st) : statement_(st), position_(0) {} - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); + virtual void bind_by_pos(int &position, + void *data, details::exchange_type type); + virtual void bind_by_name(std::string const &name, + void *data, details::exchange_type type); - virtual void preUse(eIndicator const *ind); + virtual void pre_use(indicator const *ind); virtual std::size_t size(); - virtual void cleanUp(); + virtual void clean_up(); - MySQLStatementBackEnd &statement_; + mysql_statement_backend &statement_; void *data_; - details::eExchangeType type_; + details::exchange_type type_; int position_; std::string name_; std::vector<char *> buffers_; }; -struct MySQLSessionBackEnd; -struct MySQLStatementBackEnd : details::StatementBackEnd +struct mysql_session_backend; +struct mysql_statement_backend : details::statement_backend { - MySQLStatementBackEnd(MySQLSessionBackEnd &session); + mysql_statement_backend(mysql_session_backend &session); virtual void alloc(); - virtual void cleanUp(); + virtual void clean_up(); virtual void prepare(std::string const &query, - details::eStatementType eType); + details::statement_type eType); - virtual execFetchResult execute(int number); - virtual execFetchResult fetch(int number); + virtual exec_fetch_result execute(int number); + virtual exec_fetch_result fetch(int number); - virtual int getNumberOfRows(); + virtual int get_number_of_rows(); - virtual std::string rewriteForProcedureCall(std::string const &query); + virtual std::string rewrite_for_procedure_call(std::string const &query); - virtual int prepareForDescribe(); - virtual void describeColumn(int colNum, eDataType &dtype, + virtual int prepare_for_describe(); + virtual void describe_column(int colNum, data_type &dtype, std::string &columnName); - virtual MySQLStandardIntoTypeBackEnd * makeIntoTypeBackEnd(); - virtual MySQLStandardUseTypeBackEnd * makeUseTypeBackEnd(); - virtual MySQLVectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd(); - virtual MySQLVectorUseTypeBackEnd * makeVectorUseTypeBackEnd(); + virtual mysql_standard_into_type_backend * make_into_type_backend(); + virtual mysql_standard_use_type_backend * make_use_type_backend(); + virtual mysql_vector_into_type_backend * make_vector_into_type_backend(); + virtual mysql_vector_use_type_backend * make_vector_use_type_backend(); - MySQLSessionBackEnd &session_; + mysql_session_backend &session_; MYSQL_RES *result_; @@ -172,7 +181,7 @@ struct MySQLStatementBackEnd : details::StatementBackEnd bool justDescribed_; // to optimize row description with immediately // following actual statement execution - + bool hasIntoElements_; bool hasVectorIntoElements_; bool hasUseElements_; @@ -188,20 +197,20 @@ struct MySQLStatementBackEnd : details::StatementBackEnd UseByNameBuffersMap useByNameBuffers_; }; -struct MySQLRowIDBackEnd : details::RowIDBackEnd +struct mysql_rowid_backend : details::rowid_backend { - MySQLRowIDBackEnd(MySQLSessionBackEnd &session); + mysql_rowid_backend(mysql_session_backend &session); - ~MySQLRowIDBackEnd(); + ~mysql_rowid_backend(); }; -struct MySQLBLOBBackEnd : details::BLOBBackEnd +struct mysql_blob_backend : details::blob_backend { - MySQLBLOBBackEnd(MySQLSessionBackEnd &session); + mysql_blob_backend(mysql_session_backend &session); - ~MySQLBLOBBackEnd(); + ~mysql_blob_backend(); - virtual std::size_t getLen(); + virtual std::size_t get_len(); virtual std::size_t read(std::size_t offset, char *buf, std::size_t toRead); virtual std::size_t write(std::size_t offset, char const *buf, @@ -209,38 +218,47 @@ struct MySQLBLOBBackEnd : details::BLOBBackEnd virtual std::size_t append(char const *buf, std::size_t toWrite); virtual void trim(std::size_t newLen); - MySQLSessionBackEnd &session_; + mysql_session_backend &session_; }; -struct MySQLSessionBackEnd : details::SessionBackEnd +struct mysql_session_backend : details::session_backend { - MySQLSessionBackEnd(std::string const &connectString); + mysql_session_backend(std::string const &connectString); - ~MySQLSessionBackEnd(); + ~mysql_session_backend(); virtual void begin(); virtual void commit(); virtual void rollback(); - void cleanUp(); + virtual std::string get_backend_name() const { return "mysql"; } - virtual MySQLStatementBackEnd * makeStatementBackEnd(); - virtual MySQLRowIDBackEnd * makeRowIDBackEnd(); - virtual MySQLBLOBBackEnd * makeBLOBBackEnd(); + void clean_up(); + + virtual mysql_statement_backend * make_statement_backend(); + virtual mysql_rowid_backend * make_rowid_backend(); + virtual mysql_blob_backend * make_blob_backend(); MYSQL *conn_; }; -struct MySQLBackEndFactory : BackEndFactory +struct mysql_backend_factory : backend_factory { - virtual MySQLSessionBackEnd * makeSession( + virtual mysql_session_backend * make_session( std::string const &connectString) const; }; -SOCI_MYSQL_DECL extern MySQLBackEndFactory const mysql; +extern SOCI_MYSQL_DECL mysql_backend_factory const mysql; + +extern "C" +{ + +// for dynamic backend loading +SOCI_MYSQL_DECL backend_factory const * factory_mysql(); + +} // extern "C" } // namespace SOCI #endif // SOCI_MYSQL_H_INCLUDED - diff --git a/src/backends/mysql/standard-into-type.cpp b/src/backends/mysql/standard-into-type.cpp index 138a8799..5adc5b6f 100644 --- a/src/backends/mysql/standard-into-type.cpp +++ b/src/backends/mysql/standard-into-type.cpp @@ -8,36 +8,35 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" -#include <soci.h> #include <soci-platform.h> #include "common.h" - #include <ciso646> +#include <cassert> #ifdef _MSC_VER #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::MySQL; +using namespace soci; +using namespace soci::details; +using namespace soci::details::mysql; -void MySQLStandardIntoTypeBackEnd::defineByPos( - int &position, void *data, eExchangeType type) +void mysql_standard_into_type_backend::define_by_pos( + int &position, void *data, exchange_type type) { data_ = data; type_ = type; position_ = position++; } -void MySQLStandardIntoTypeBackEnd::preFetch() +void mysql_standard_into_type_backend::pre_fetch() { // nothing to do here } -void MySQLStandardIntoTypeBackEnd::postFetch( - bool gotData, bool calledFromFetch, eIndicator *ind) +void mysql_standard_into_type_backend::post_fetch( + bool gotData, bool calledFromFetch, indicator *ind) { if (calledFromFetch == true && gotData == false) { @@ -55,101 +54,102 @@ void MySQLStandardIntoTypeBackEnd::postFetch( { if (ind == NULL) { - throw SOCIError( + throw soci_error( "Null value fetched and no indicator defined."); } - *ind = eNull; + *ind = i_null; return; } else { if (ind != NULL) { - *ind = eOK; + *ind = i_ok; } } const char *buf = row[pos] != NULL ? row[pos] : ""; switch (type_) { - case eXChar: + case x_char: { char *dest = static_cast<char*>(data_); *dest = *buf; } break; - case eXCString: + case x_cstring: { - CStringDescriptor *strDescr - = static_cast<CStringDescriptor *>(data_); + cstring_descriptor *strDescr + = static_cast<cstring_descriptor *>(data_); std::strncpy(strDescr->str_, buf, strDescr->bufSize_ - 1); strDescr->str_[strDescr->bufSize_ - 1] = '\0'; if (std::strlen(buf) >= strDescr->bufSize_ && ind != NULL) { - *ind = eTruncated; + *ind = i_truncated; } } break; - case eXStdString: + case x_stdstring: { std::string *dest = static_cast<std::string *>(data_); - dest->assign(buf); + + MYSQL_FIELD* field = mysql_fetch_field_direct(statement_.result_, pos); + assert(0 != field); + if (MYSQL_TYPE_BLOB == field->type) + { + dest->assign(buf, field->max_length); + } + else + { + dest->assign(buf); + } } break; - case eXShort: + case x_short: { short *dest = static_cast<short*>(data_); - long val = strtol(buf, NULL, 10); - *dest = static_cast<short>(val); + parse_num(buf, *dest); } break; - case eXInteger: + case x_integer: { int *dest = static_cast<int*>(data_); - long val = strtol(buf, NULL, 10); - *dest = static_cast<int>(val); + parse_num(buf, *dest); } break; - case eXUnsignedLong: + case x_unsigned_long: { unsigned long *dest = static_cast<unsigned long *>(data_); - long long val = strtoll(buf, NULL, 10); - *dest = static_cast<unsigned long>(val); + parse_num(buf, *dest); + } + break; + case x_long_long: + { + long long *dest = static_cast<long long *>(data_); + parse_num(buf, *dest); } break; - case eXDouble: + case x_double: { double *dest = static_cast<double*>(data_); - double val = strtod(buf, NULL); - *dest = static_cast<double>(val); + parse_num(buf, *dest); } break; - case eXStdTm: + case x_stdtm: { // attempt to parse the string and convert to std::tm std::tm *dest = static_cast<std::tm *>(data_); - parseStdTm(buf, *dest); + parse_std_tm(buf, *dest); } break; default: - throw SOCIError("Into element used with non-supported type."); - } - } - else // no data retrieved - { - if (ind != NULL) - { - *ind = eNoData; - } - else - { - throw SOCIError("No data fetched and no indicator defined."); + throw soci_error("Into element used with non-supported type."); } } } -void MySQLStandardIntoTypeBackEnd::cleanUp() +void mysql_standard_into_type_backend::clean_up() { // nothing to do here } diff --git a/src/backends/mysql/standard-use-type.cpp b/src/backends/mysql/standard-use-type.cpp index c102bb41..7049140a 100644 --- a/src/backends/mysql/standard-use-type.cpp +++ b/src/backends/mysql/standard-use-type.cpp @@ -9,70 +9,70 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" #include "common.h" -#include <soci.h> #include <soci-platform.h> #include <ciso646> #include <limits> +#include <cstring> #ifdef _MSC_VER #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::MySQL; +using namespace soci; +using namespace soci::details; +using namespace soci::details::mysql; -void MySQLStandardUseTypeBackEnd::bindByPos( - int &position, void *data, eExchangeType type) +void mysql_standard_use_type_backend::bind_by_pos( + int &position, void *data, exchange_type type, bool /* readOnly */) { data_ = data; type_ = type; position_ = position++; } -void MySQLStandardUseTypeBackEnd::bindByName( - std::string const &name, void *data, eExchangeType type) +void mysql_standard_use_type_backend::bind_by_name( + std::string const &name, void *data, exchange_type type, bool /* readOnly */) { data_ = data; type_ = type; name_ = name; } -void MySQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) +void mysql_standard_use_type_backend::pre_use(indicator const *ind) { - if (ind != NULL && *ind == eNull) + if (ind != NULL && *ind == i_null) { buf_ = new char[5]; - strcpy(buf_, "NULL"); + std::strcpy(buf_, "NULL"); } else { // allocate and fill the buffer with text-formatted client data switch (type_) { - case eXChar: + case x_char: { char buf[] = { *static_cast<char*>(data_), '\0' }; buf_ = quote(statement_.session_.conn_, buf, 1); } break; - case eXCString: + case x_cstring: { - CStringDescriptor *strDescr - = static_cast<CStringDescriptor *>(data_); + cstring_descriptor *strDescr + = static_cast<cstring_descriptor *>(data_); buf_ = quote(statement_.session_.conn_, strDescr->str_, - std::strlen(strDescr->str_)); + std::strlen(strDescr->str_)); } break; - case eXStdString: + case x_stdstring: { std::string *s = static_cast<std::string *>(data_); buf_ = quote(statement_.session_.conn_, - s->c_str(), s->size()); + s->c_str(), s->size()); } break; - case eXShort: + case x_short: { std::size_t const bufSize = std::numeric_limits<short>::digits10 + 3; @@ -81,7 +81,7 @@ void MySQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) static_cast<int>(*static_cast<short*>(data_))); } break; - case eXInteger: + case x_integer: { std::size_t const bufSize = std::numeric_limits<int>::digits10 + 3; @@ -89,7 +89,7 @@ void MySQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf_, bufSize, "%d", *static_cast<int*>(data_)); } break; - case eXUnsignedLong: + case x_unsigned_long: { std::size_t const bufSize = std::numeric_limits<unsigned long>::digits10 + 2; @@ -98,7 +98,15 @@ void MySQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) *static_cast<unsigned long*>(data_)); } break; - case eXDouble: + case x_long_long: + { + std::size_t const bufSize + = std::numeric_limits<long long>::digits10 + 3; + buf_ = new char[bufSize]; + snprintf(buf_, bufSize, "%lld", *static_cast<long long *>(data_)); + } + break; + case x_double: { // no need to overengineer it (KISS)... @@ -109,7 +117,7 @@ void MySQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) *static_cast<double*>(data_)); } break; - case eXStdTm: + case x_stdtm: { std::size_t const bufSize = 22; buf_ = new char[bufSize]; @@ -122,7 +130,7 @@ void MySQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) } break; default: - throw SOCIError("Use element used with non-supported type."); + throw soci_error("Use element used with non-supported type."); } } @@ -138,12 +146,24 @@ void MySQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) } } -void MySQLStandardUseTypeBackEnd::postUse(bool gotData, eIndicator *ind) +void mysql_standard_use_type_backend::post_use(bool gotData, indicator *ind) { - cleanUp(); + // TODO: Is it possible to have the bound element being overwritten + // by the database? + // If not, then nothing to do here, please remove this comment. + // If yes, then use the value of the readOnly parameter: + // - true: the given object should not be modified and the backend + // should detect if the modification was performed on the + // isolated buffer and throw an exception if the buffer was modified + // (this indicates logic error, because the user used const object + // and executed a query that attempted to modified it) + // - false: the modification should be propagated to the given object. + // ... + + clean_up(); } -void MySQLStandardUseTypeBackEnd::cleanUp() +void mysql_standard_use_type_backend::clean_up() { if (buf_ != NULL) { @@ -151,4 +171,3 @@ void MySQLStandardUseTypeBackEnd::cleanUp() buf_ = NULL; } } - diff --git a/src/backends/mysql/statement.cpp b/src/backends/mysql/statement.cpp index afa296ae..542af95a 100644 --- a/src/backends/mysql/statement.cpp +++ b/src/backends/mysql/statement.cpp @@ -8,7 +8,6 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" -#include <soci.h> #include <cctype> #include <ciso646> //#include <iostream> @@ -17,24 +16,25 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; using std::string; -MySQLStatementBackEnd::MySQLStatementBackEnd(MySQLSessionBackEnd &session) +mysql_statement_backend::mysql_statement_backend( + mysql_session_backend &session) : session_(session), result_(NULL), justDescribed_(false), hasIntoElements_(false), hasVectorIntoElements_(false), hasUseElements_(false), hasVectorUseElements_(false) { } -void MySQLStatementBackEnd::alloc() +void mysql_statement_backend::alloc() { // nothing to do here. } -void MySQLStatementBackEnd::cleanUp() +void mysql_statement_backend::clean_up() { if (result_ != NULL) { @@ -43,8 +43,8 @@ void MySQLStatementBackEnd::cleanUp() } } -void MySQLStatementBackEnd::prepare(std::string const & query, - eStatementType /* eType */) +void mysql_statement_backend::prepare(std::string const & query, + statement_type /* eType */) { queryChunks_.clear(); enum { eNormal, eInQuotes, eInName } state = eNormal; @@ -121,16 +121,16 @@ void MySQLStatementBackEnd::prepare(std::string const & query, */ } -StatementBackEnd::execFetchResult -MySQLStatementBackEnd::execute(int number) +statement_backend::exec_fetch_result +mysql_statement_backend::execute(int number) { if (justDescribed_ == false) { - cleanUp(); + clean_up(); if (number > 1 && hasIntoElements_) { - throw SOCIError( + throw soci_error( "Bulk use with single into elements is not supported."); } // number - size of vectors (into/use) @@ -142,11 +142,11 @@ MySQLStatementBackEnd::execute(int number) } std::string query; - if (!useByPosBuffers_.empty() || !useByNameBuffers_.empty()) + if (not useByPosBuffers_.empty() or not useByNameBuffers_.empty()) { - if (!useByPosBuffers_.empty() && !useByNameBuffers_.empty()) + if (not useByPosBuffers_.empty() and not useByNameBuffers_.empty()) { - throw SOCIError( + throw soci_error( "Binding for use elements must be either by position " "or by name."); } @@ -154,7 +154,7 @@ MySQLStatementBackEnd::execute(int number) { std::vector<char *> paramValues; - if (!useByPosBuffers_.empty()) + if (not useByPosBuffers_.empty()) { // use elements bind by position // the map of use buffers can be traversed @@ -186,7 +186,7 @@ MySQLStatementBackEnd::execute(int number) "Missing use element for bind by name ("); msg += *it; msg += ")."; - throw SOCIError(msg); + throw soci_error(msg); } char **buffers = b->second; paramValues.push_back(buffers[i]); @@ -197,14 +197,15 @@ MySQLStatementBackEnd::execute(int number) if (queryChunks_.size() != paramValues.size() and queryChunks_.size() != paramValues.size() + 1) { - throw SOCIError("Wrong number of parameters."); + throw soci_error("Wrong number of parameters."); } - + std::vector<std::string>::const_iterator ci = queryChunks_.begin(); for (std::vector<char*>::const_iterator pi = paramValues.begin(), end = paramValues.end(); - pi != end; ++ci, ++pi) { + pi != end; ++ci, ++pi) + { query += *ci; query += *pi; } @@ -215,15 +216,16 @@ MySQLStatementBackEnd::execute(int number) if (numberOfExecutions > 1) { // bulk operation - //cerr << query << endl; + //std::cerr << "bulk operation:\n" << query << std::endl; if (0 != mysql_real_query(session_.conn_, query.c_str(), query.size())) { - throw SOCIError(mysql_error(session_.conn_)); + throw mysql_soci_error(mysql_error(session_.conn_), + mysql_errno(session_.conn_)); } if (mysql_field_count(session_.conn_) != 0) { - throw SOCIError("The query shouldn't have returned" + throw soci_error("The query shouldn't have returned" " any data but it did."); } query.clear(); @@ -232,7 +234,7 @@ MySQLStatementBackEnd::execute(int number) if (numberOfExecutions > 1) { // bulk - return eNoData; + return ef_no_data; } } else @@ -240,16 +242,18 @@ MySQLStatementBackEnd::execute(int number) query = queryChunks_.front(); } - //cerr << query << endl; + //std::cerr << query << std::endl; if (0 != mysql_real_query(session_.conn_, query.c_str(), query.size())) { - throw SOCIError(mysql_error(session_.conn_)); + throw mysql_soci_error(mysql_error(session_.conn_), + mysql_errno(session_.conn_)); } result_ = mysql_store_result(session_.conn_); if (result_ == NULL and mysql_field_count(session_.conn_) != 0) { - throw SOCIError(mysql_error(session_.conn_)); + throw mysql_soci_error(mysql_error(session_.conn_), + mysql_errno(session_.conn_)); } } else @@ -261,11 +265,11 @@ MySQLStatementBackEnd::execute(int number) { currentRow_ = 0; rowsToConsume_ = 0; - + numberOfRows_ = mysql_num_rows(result_); if (numberOfRows_ == 0) { - return eNoData; + return ef_no_data; } else { @@ -277,19 +281,19 @@ MySQLStatementBackEnd::execute(int number) else { // execute(0) was meant to only perform the query - return eSuccess; + return ef_success; } } } else { // it was not a SELECT - return eNoData; + return ef_no_data; } } -StatementBackEnd::execFetchResult -MySQLStatementBackEnd::fetch(int number) +statement_backend::exec_fetch_result +mysql_statement_backend::fetch(int number) { // Note: This function does not actually fetch anything from anywhere // - the data was already retrieved from the server in the execute() @@ -303,7 +307,7 @@ MySQLStatementBackEnd::fetch(int number) if (currentRow_ >= numberOfRows_) { // all rows were already consumed - return eNoData; + return ef_no_data; } else { @@ -312,24 +316,24 @@ MySQLStatementBackEnd::fetch(int number) rowsToConsume_ = numberOfRows_ - currentRow_; // this simulates the behaviour of Oracle - // - when EOF is hit, we return eNoData even when there are + // - when EOF is hit, we return ef_no_data even when there are // actually some rows fetched - return eNoData; + return ef_no_data; } else { rowsToConsume_ = number; - return eSuccess; + return ef_success; } } } -int MySQLStatementBackEnd::getNumberOfRows() +int mysql_statement_backend::get_number_of_rows() { return numberOfRows_ - currentRow_; } -std::string MySQLStatementBackEnd::rewriteForProcedureCall( +std::string mysql_statement_backend::rewrite_for_procedure_call( std::string const &query) { std::string newQuery("select "); @@ -337,7 +341,7 @@ std::string MySQLStatementBackEnd::rewriteForProcedureCall( return newQuery; } -int MySQLStatementBackEnd::prepareForDescribe() +int mysql_statement_backend::prepare_for_describe() { execute(1); justDescribed_ = true; @@ -346,18 +350,21 @@ int MySQLStatementBackEnd::prepareForDescribe() return columns; } -void MySQLStatementBackEnd::describeColumn(int colNum, - eDataType & type, std::string & columnName) +void mysql_statement_backend::describe_column(int colNum, + data_type & type, std::string & columnName) { int pos = colNum - 1; MYSQL_FIELD *field = mysql_fetch_field_direct(result_, pos); - switch (field->type) { + switch (field->type) + { case FIELD_TYPE_CHAR: //MYSQL_TYPE_TINY: case FIELD_TYPE_SHORT: //MYSQL_TYPE_SHORT: case FIELD_TYPE_LONG: //MYSQL_TYPE_LONG: - case FIELD_TYPE_LONGLONG: //MYSQL_TYPE_LONGLONG: case FIELD_TYPE_INT24: //MYSQL_TYPE_INT24: - type = eInteger; + type = dt_integer; + break; + case FIELD_TYPE_LONGLONG: //MYSQL_TYPE_LONGLONG: + type = dt_long_long; break; case FIELD_TYPE_FLOAT: //MYSQL_TYPE_FLOAT: case FIELD_TYPE_DOUBLE: //MYSQL_TYPE_DOUBLE: @@ -367,7 +374,7 @@ void MySQLStatementBackEnd::describeColumn(int colNum, // sends field type number 246, no matter which version of libraries // the client is using. case 246: //MYSQL_TYPE_NEWDECIMAL: - type = eDouble; + type = dt_double; break; case FIELD_TYPE_TIMESTAMP: //MYSQL_TYPE_TIMESTAMP: case FIELD_TYPE_DATE: //MYSQL_TYPE_DATE: @@ -375,42 +382,45 @@ void MySQLStatementBackEnd::describeColumn(int colNum, case FIELD_TYPE_DATETIME: //MYSQL_TYPE_DATETIME: case FIELD_TYPE_YEAR: //MYSQL_TYPE_YEAR: case FIELD_TYPE_NEWDATE: //MYSQL_TYPE_NEWDATE: - type = eDate; + type = dt_date; break; // case MYSQL_TYPE_VARCHAR: case FIELD_TYPE_VAR_STRING: //MYSQL_TYPE_VAR_STRING: case FIELD_TYPE_STRING: //MYSQL_TYPE_STRING: - type = eString; + case FIELD_TYPE_BLOB: // TEXT OR BLOB + type = dt_string; break; default: //std::cerr << "field->type: " << field->type << std::endl; - throw SOCIError("Unknown data type."); + throw soci_error("Unknown data type."); } columnName = field->name; } -MySQLStandardIntoTypeBackEnd * MySQLStatementBackEnd::makeIntoTypeBackEnd() +mysql_standard_into_type_backend * +mysql_statement_backend::make_into_type_backend() { hasIntoElements_ = true; - return new MySQLStandardIntoTypeBackEnd(*this); + return new mysql_standard_into_type_backend(*this); } -MySQLStandardUseTypeBackEnd * MySQLStatementBackEnd::makeUseTypeBackEnd() +mysql_standard_use_type_backend * +mysql_statement_backend::make_use_type_backend() { hasUseElements_ = true; - return new MySQLStandardUseTypeBackEnd(*this); + return new mysql_standard_use_type_backend(*this); } -MySQLVectorIntoTypeBackEnd * -MySQLStatementBackEnd::makeVectorIntoTypeBackEnd() +mysql_vector_into_type_backend * +mysql_statement_backend::make_vector_into_type_backend() { hasVectorIntoElements_ = true; - return new MySQLVectorIntoTypeBackEnd(*this); + return new mysql_vector_into_type_backend(*this); } -MySQLVectorUseTypeBackEnd * MySQLStatementBackEnd::makeVectorUseTypeBackEnd() +mysql_vector_use_type_backend * +mysql_statement_backend::make_vector_use_type_backend() { hasVectorUseElements_ = true; - return new MySQLVectorUseTypeBackEnd(*this); + return new mysql_vector_use_type_backend(*this); } - diff --git a/src/backends/mysql/test/Makefile.am b/src/backends/mysql/test/Makefile.am deleted file mode 100644 index b6ffc6e6..00000000 --- a/src/backends/mysql/test/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/backends/mysql - -AM_CPPFLAGS = @MYSQL_CFLAGS@ -AM_LDFLAGS = @MYSQL_LDFLAGS@ - -noinst_PROGRAMS = \ - test_mysql - -test_mysql_SOURCES = \ - test-mysql.cpp - -test_mysql_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/mysql/lib@SOCI_MYSQL_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/mysql/test/Makefile.basic b/src/backends/mysql/test/Makefile.basic index eb431d61..0792406b 100644 --- a/src/backends/mysql/test/Makefile.basic +++ b/src/backends/mysql/test/Makefile.basic @@ -11,7 +11,7 @@ COMPILER = g++ CXXFLAGS = -Wall -pedantic -Wno-long-long INCLUDEDIRS = -I.. -I../../../core ${MYSQLINCLUDEDIR} LIBDIRS = -L.. -L../../../core ${MYSQLLIBDIR} -LIBS = -lsoci-core -lsoci-mysql ${MYSQLLIBS} +LIBS = -lsoci_core -lsoci_mysql -ldl ${MYSQLLIBS} test-mysql : test-mysql.cpp diff --git a/src/backends/mysql/test/Makefile.in b/src/backends/mysql/test/Makefile.in deleted file mode 100644 index d22dbb6a..00000000 --- a/src/backends/mysql/test/Makefile.in +++ /dev/null @@ -1,483 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -noinst_PROGRAMS = test_mysql$(EXEEXT) -subdir = src/backends/mysql/test -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_test_mysql_OBJECTS = test-mysql.$(OBJEXT) -test_mysql_OBJECTS = $(am_test_mysql_OBJECTS) -test_mysql_DEPENDENCIES = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/mysql/lib@SOCI_MYSQL_LIBRARY_NAME@.la -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(test_mysql_SOURCES) -DIST_SOURCES = $(test_mysql_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/backends/mysql - -AM_CPPFLAGS = @MYSQL_CFLAGS@ -AM_LDFLAGS = @MYSQL_LDFLAGS@ -test_mysql_SOURCES = \ - test-mysql.cpp - -test_mysql_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/mysql/lib@SOCI_MYSQL_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/mysql/test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/mysql/test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_mysql$(EXEEXT): $(test_mysql_OBJECTS) $(test_mysql_DEPENDENCIES) - @rm -f test_mysql$(EXEEXT) - $(CXXLINK) $(test_mysql_LDFLAGS) $(test_mysql_OBJECTS) $(test_mysql_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mysql.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/mysql/test/test-mysql.cpp b/src/backends/mysql/test/test-mysql.cpp index 0cbe8a45..326459bc 100644 --- a/src/backends/mysql/test/test-mysql.cpp +++ b/src/backends/mysql/test/test-mysql.cpp @@ -1,30 +1,41 @@ +// +// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// MySQL backend copyright (C) 2006 Pawel Aleksander Fedorynski +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + #include "soci.h" #include "soci-mysql.h" #include "test/common-tests.h" #include <iostream> #include <sstream> #include <string> +#include <vector> #include <cassert> #include <cmath> #include <ctime> #include <ciso646> #include <cstdlib> +#include <mysqld_error.h> +#include <errmsg.h> -using namespace SOCI; -using namespace SOCI::tests; +using namespace soci; +using namespace soci::tests; std::string connectString; -BackEndFactory const &backEnd = mysql; +backend_factory const &backEnd = mysql; // procedure call test void test1() { { - Session sql(backEnd, connectString); - - MySQLSessionBackEnd *sessionBackEnd - = static_cast<MySQLSessionBackEnd *>(sql.getBackEnd()); + session sql(backEnd, connectString); + + mysql_session_backend *sessionBackEnd + = static_cast<mysql_session_backend *>(sql.get_backend()); std::string version = mysql_get_server_info(sessionBackEnd->conn_); int v; std::istringstream iss(version); @@ -34,19 +45,19 @@ void test1() std::cout << version << " does not support stored procedures)\n"; return; } - + try { sql << "drop function myecho"; } - catch (SOCIError const &) {} - + catch (soci_error const &) {} + sql << "create function myecho(msg text) " "returns text deterministic " " return msg; "; - + std::string in("my message"); std::string out; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select myecho(:input)", into(out), use(in, "input")); @@ -59,7 +70,7 @@ void test1() std::string in("my message2"); std::string out; - Procedure proc = (sql.prepare << + procedure proc = (sql.prepare << "myecho(:input)", into(out), use(in, "input")); @@ -73,33 +84,236 @@ void test1() std::cout << "test 1 passed" << std::endl; } +// MySQL error reporting test. +void test2() +{ + { + try + { + session sql(backEnd, "host=test.soci.invalid"); + } + catch (mysql_soci_error const &e) + { + assert(e.err_num_ == CR_UNKNOWN_HOST); + } + } + + { + session sql(backEnd, connectString); + sql << "create table soci_test (id integer)"; + try + { + int n; + sql << "select id from soci_test_nosuchtable", into(n); + } + catch (mysql_soci_error const &e) + { + assert(e.err_num_ == ER_NO_SUCH_TABLE); + } + try + { + sql << "insert into soci_test (invalid) values (256)"; + } + catch (mysql_soci_error const &e) + { + assert(e.err_num_ == ER_BAD_FIELD_ERROR); + } + // A bulk operation. + try + { + std::vector<int> v(3, 5); + sql << "insert into soci_test_nosuchtable values (:n)", use(v); + } + catch (mysql_soci_error const &e) + { + assert(e.err_num_ == ER_NO_SUCH_TABLE); + } + sql << "drop table soci_test"; + } + + std::cout << "test 2 passed" << std::endl; +} + +struct longlong_table_creator : table_creator_base +{ + longlong_table_creator(session & sql) + : table_creator_base(sql) + { + sql << "create table soci_test(val bigint)"; + } +}; + +// long long test +void test3() +{ + { + session sql(backEnd, connectString); + + longlong_table_creator tableCreator(sql); + + long long v1 = 1000000000000LL; + assert(v1 / 1000000 == 1000000); + + sql << "insert into soci_test(val) values(:val)", use(v1); + + long long v2 = 0LL; + sql << "select val from soci_test", into(v2); + + assert(v2 == v1); + } + + // vector<long long> + { + session sql(backEnd, connectString); + + longlong_table_creator tableCreator(sql); + + std::vector<long long> v1; + v1.push_back(1000000000000LL); + v1.push_back(1000000000001LL); + v1.push_back(1000000000002LL); + v1.push_back(1000000000003LL); + v1.push_back(1000000000004LL); + + sql << "insert into soci_test(val) values(:val)", use(v1); + + std::vector<long long> v2(10); + sql << "select val from soci_test order by val desc", into(v2); + + assert(v2.size() == 5); + assert(v2[0] == 1000000000004LL); + assert(v2[1] == 1000000000003LL); + assert(v2[2] == 1000000000002LL); + assert(v2[3] == 1000000000001LL); + assert(v2[4] == 1000000000000LL); + } + + std::cout << "test 3 passed" << std::endl; +} + +template <typename T> +void test_num(const char* s, bool valid, T value) +{ + try + { + session sql(backEnd, connectString); + T val; + sql << "select \'" << s << "\'", into(val); + if (valid) + { + double v1 = value; + double v2 = val; + double d = std::fabs(v1 - v2); + double epsilon = 0.001; + assert(d < epsilon || + d < epsilon * (std::fabs(v1) + std::fabs(v2))); + } + else + { + std::cout << "string \"" << s << "\" parsed as " << val + << " but should have failed.\n"; + assert(false); + } + } + catch (soci_error const& e) + { + if (valid) + { + std::cout << "couldn't parse number: \"" << s << "\"\n"; + assert(false); + } + else + { + assert(std::string(e.what()) == "Cannot convert data."); + } + } +} + +// Number conversion test. +void test4() +{ + test_num<double>("", false, 0); + test_num<double>("foo", false, 0); + test_num<double>("1", true, 1); + test_num<double>("12", true, 12); + test_num<double>("123", true, 123); + test_num<double>("12345", true, 12345); + test_num<double>("12341234123412341234123412341234123412341234123412341", + true, 1.23412e+52); + test_num<double>("99999999999999999999999912222222222222222222222222223" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333" + "9999999999999999999999991222222222222222222222222222333333333333", + false, 0); + test_num<double>("1e3", true, 1000); + test_num<double>("1.2", true, 1.2); + test_num<double>("1.2345e2", true, 123.45); + test_num<double>("1 ", false, 0); + test_num<double>(" 123", true, 123); + test_num<double>("1,2", false, 0); + test_num<double>("123abc", false, 0); + test_num<double>("-0", true, 0); + + test_num<short>("123", true, 123); + test_num<short>("100000", false, 0); + + test_num<int>("123", true, 123); + test_num<int>("2147483647", true, 2147483647); + test_num<int>("2147483647a", false, 0); + test_num<int>("2147483648", false, 0); + // -2147483648 causes a warning because it is interpreted as + // 2147483648 (which doesn't fit in an integer) to which a negation + // is applied. + test_num<int>("-2147483648", true, -2147483647 - 1); + test_num<int>("-2147483649", false, 0); + test_num<int>("-0", true, 0); + test_num<int>("1.1", false, 0); + + test_num<long long>("123", true, 123); + test_num<long long>("9223372036854775807", true, 9223372036854775807LL); + test_num<long long>("9223372036854775808", false, 0); + + std::cout << "test 4 passed" << std::endl; +} + // DDL Creation objects for common tests -struct TableCreator1 : public TableCreatorBase +struct table_creator_one : public table_creator_base { - TableCreator1(Session& session) - : TableCreatorBase(session) + table_creator_one(session& session) + : table_creator_base(session) { session << "create table soci_test(id integer, val integer, c char, " "str varchar(20), sh int2, ul numeric(20), d float8, " - "tm datetime, i1 integer, i2 integer, i3 integer, " + "tm datetime, i1 integer, i2 integer, i3 integer, " "name varchar(20)) type=InnoDB"; } }; -struct TableCreator2 : public TableCreatorBase +struct table_creator_two : public table_creator_base { - TableCreator2(Session& session) - : TableCreatorBase(session) + table_creator_two(session& session) + : table_creator_base(session) { session << "create table soci_test(num_float float8, num_int integer," " name varchar(20), sometime datetime, chr char)"; } }; -struct TableCreator3 : public TableCreatorBase +struct table_creator_three : public table_creator_base { - TableCreator3(Session& session) - : TableCreatorBase(session) + table_creator_three(session& session) + : table_creator_base(session) { session << "create table soci_test(name varchar(100) not null, " "phone varchar(15))"; @@ -110,41 +324,41 @@ struct TableCreator3 : public TableCreatorBase // Support for SOCI Common Tests // -class TestContext : public TestContextBase +class test_context : public test_context_base { public: - TestContext(BackEndFactory const &backEnd, + test_context(backend_factory const &backEnd, std::string const &connectString) - : TestContextBase(backEnd, connectString) {} + : test_context_base(backEnd, connectString) {} - TableCreatorBase* tableCreator1(Session& s) const + table_creator_base* table_creator_1(session& s) const { - return new TableCreator1(s); + return new table_creator_one(s); } - TableCreatorBase* tableCreator2(Session& s) const + table_creator_base* table_creator_2(session& s) const { - return new TableCreator2(s); + return new table_creator_two(s); } - TableCreatorBase* tableCreator3(Session& s) const + table_creator_base* table_creator_3(session& s) const { - return new TableCreator3(s); + return new table_creator_three(s); } - std::string toDateTime(std::string const &dateString) const + std::string to_date_time(std::string const &datdt_string) const { - return "\'" + dateString + "\'"; + return "\'" + datdt_string + "\'"; } }; -bool areTransactionsSupported() +bool are_transactions_supported() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); sql << "drop table if exists soci_test"; sql << "create table soci_test (id int) type=InnoDB"; - Row r; + row r; sql << "show table status like \'soci_test\'", into(r); bool retv = (r.get<std::string>(1) == "InnoDB"); sql << "drop table soci_test"; @@ -163,19 +377,22 @@ int main(int argc, char** argv) << " connectstring\n" << "example: " << argv[0] << " \"dbname=test user=root password=\'Ala ma kota\'\"\n"; - exit(1); + std::exit(1); } try { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); - bool checkTransactions = areTransactionsSupported(); + test_context tc(backEnd, connectString); + common_tests tests(tc); + bool checkTransactions = are_transactions_supported(); tests.run(checkTransactions); std::cout << "\nSOCI MySQL Tests:\n\n"; test1(); + test2(); + test3(); + test4(); std::cout << "\nOK, all tests passed.\n\n"; return EXIT_SUCCESS; diff --git a/src/backends/mysql/vector-into-type.cpp b/src/backends/mysql/vector-into-type.cpp index 274d3849..1d6c0c04 100644 --- a/src/backends/mysql/vector-into-type.cpp +++ b/src/backends/mysql/vector-into-type.cpp @@ -9,7 +9,6 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" #include "common.h" -#include <soci.h> #include <soci-platform.h> #include <ciso646> @@ -17,20 +16,20 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::MySQL; +using namespace soci; +using namespace soci::details; +using namespace soci::details::mysql; -void MySQLVectorIntoTypeBackEnd::defineByPos( - int &position, void *data, eExchangeType type) +void mysql_vector_into_type_backend::define_by_pos( + int &position, void *data, exchange_type type) { data_ = data; type_ = type; position_ = position++; } -void MySQLVectorIntoTypeBackEnd::preFetch() +void mysql_vector_into_type_backend::pre_fetch() { // nothing to do here } @@ -38,8 +37,8 @@ void MySQLVectorIntoTypeBackEnd::preFetch() namespace // anonymous { -template <typename T, typename U> -void setInVector(void *p, int indx, U const &val) +template <typename T> +void set_invector_(void *p, int indx, T const &val) { std::vector<T> *dest = static_cast<std::vector<T> *>(p); @@ -50,7 +49,7 @@ void setInVector(void *p, int indx, U const &val) } // namespace anonymous -void MySQLVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) +void mysql_vector_into_type_backend::post_fetch(bool gotData, indicator *ind) { if (gotData) { @@ -61,7 +60,7 @@ void MySQLVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) int pos = position_ - 1; int const endRow = statement_.currentRow_ + statement_.rowsToConsume_; - + mysql_data_seek(statement_.result_, statement_.currentRow_); for (int curRow = statement_.currentRow_, i = 0; curRow != endRow; ++curRow, ++i) @@ -72,17 +71,20 @@ void MySQLVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) { if (ind == NULL) { - throw SOCIError( + throw soci_error( "Null value fetched and no indicator defined."); } - ind[i] = eNull; + ind[i] = i_null; + + // no need to convert data if it is null, go to next row + continue; } else { if (ind != NULL) { - ind[i] = eOK; + ind[i] = i_ok; } } @@ -91,49 +93,59 @@ void MySQLVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) switch (type_) { - case eXChar: - setInVector<char>(data_, i, *buf); + case x_char: + set_invector_(data_, i, *buf); + break; + case x_stdstring: + set_invector_<std::string>(data_, i, buf); break; - case eXStdString: - setInVector<std::string>(data_, i, buf); + case x_short: + { + short val; + parse_num(buf, val); + set_invector_(data_, i, val); + } break; - case eXShort: + case x_integer: { - long val = strtol(buf, NULL, 10); - setInVector<short>(data_, i, static_cast<short>(val)); + int val; + parse_num(buf, val); + set_invector_(data_, i, val); } break; - case eXInteger: + case x_unsigned_long: { - long val = strtol(buf, NULL, 10); - setInVector<int>(data_, i, static_cast<int>(val)); + unsigned long val; + parse_num(buf, val); + set_invector_(data_, i, val); } break; - case eXUnsignedLong: + case x_long_long: { - long long val = strtoll(buf, NULL, 10); - setInVector<unsigned long>(data_, i, - static_cast<unsigned long>(val)); + long long val; + parse_num(buf, val); + set_invector_(data_, i, val); } break; - case eXDouble: + case x_double: { - double val = strtod(buf, NULL); - setInVector<double>(data_, i, val); + double val; + parse_num(buf, val); + set_invector_(data_, i, val); } break; - case eXStdTm: + case x_stdtm: { // attempt to parse the string and convert to std::tm std::tm t; - parseStdTm(buf, t); + parse_std_tm(buf, t); - setInVector<std::tm>(data_, i, t); + set_invector_(data_, i, t); } break; default: - throw SOCIError("Into element used with non-supported type."); + throw soci_error("Into element used with non-supported type."); } } } @@ -147,7 +159,7 @@ namespace // anonymous { template <typename T> -void resizeVector(void *p, std::size_t sz) +void resizevector_(void *p, std::size_t sz) { std::vector<T> *v = static_cast<std::vector<T> *>(p); v->resize(sz); @@ -155,47 +167,48 @@ void resizeVector(void *p, std::size_t sz) } // namespace anonymous -void MySQLVectorIntoTypeBackEnd::resize(std::size_t sz) +void mysql_vector_into_type_backend::resize(std::size_t sz) { switch (type_) { // simple cases - case eXChar: resizeVector<char> (data_, sz); break; - case eXShort: resizeVector<short> (data_, sz); break; - case eXInteger: resizeVector<int> (data_, sz); break; - case eXUnsignedLong: resizeVector<unsigned long>(data_, sz); break; - case eXDouble: resizeVector<double> (data_, sz); break; - case eXStdString: resizeVector<std::string> (data_, sz); break; - case eXStdTm: resizeVector<std::tm> (data_, sz); break; + case x_char: resizevector_<char> (data_, sz); break; + case x_short: resizevector_<short> (data_, sz); break; + case x_integer: resizevector_<int> (data_, sz); break; + case x_unsigned_long: resizevector_<unsigned long>(data_, sz); break; + case x_long_long: resizevector_<long long> (data_, sz); break; + case x_double: resizevector_<double> (data_, sz); break; + case x_stdstring: resizevector_<std::string> (data_, sz); break; + case x_stdtm: resizevector_<std::tm> (data_, sz); break; default: - throw SOCIError("Into vector element used with non-supported type."); + throw soci_error("Into vector element used with non-supported type."); } } -std::size_t MySQLVectorIntoTypeBackEnd::size() +std::size_t mysql_vector_into_type_backend::size() { std::size_t sz = 0; // dummy initialization to please the compiler switch (type_) { // simple cases - case eXChar: sz = getVectorSize<char> (data_); break; - case eXShort: sz = getVectorSize<short> (data_); break; - case eXInteger: sz = getVectorSize<int> (data_); break; - case eXUnsignedLong: sz = getVectorSize<unsigned long>(data_); break; - case eXDouble: sz = getVectorSize<double> (data_); break; - case eXStdString: sz = getVectorSize<std::string> (data_); break; - case eXStdTm: sz = getVectorSize<std::tm> (data_); break; + case x_char: sz = get_vector_size<char> (data_); break; + case x_short: sz = get_vector_size<short> (data_); break; + case x_integer: sz = get_vector_size<int> (data_); break; + case x_unsigned_long: sz = get_vector_size<unsigned long>(data_); break; + case x_long_long: sz = get_vector_size<long long> (data_); break; + case x_double: sz = get_vector_size<double> (data_); break; + case x_stdstring: sz = get_vector_size<std::string> (data_); break; + case x_stdtm: sz = get_vector_size<std::tm> (data_); break; default: - throw SOCIError("Into vector element used with non-supported type."); + throw soci_error("Into vector element used with non-supported type."); } return sz; } -void MySQLVectorIntoTypeBackEnd::cleanUp() +void mysql_vector_into_type_backend::clean_up() { // nothing to do here } - diff --git a/src/backends/mysql/vector-use-type.cpp b/src/backends/mysql/vector-use-type.cpp index a60ffc76..265b7f3c 100644 --- a/src/backends/mysql/vector-use-type.cpp +++ b/src/backends/mysql/vector-use-type.cpp @@ -9,75 +9,75 @@ #define SOCI_MYSQL_SOURCE #include "soci-mysql.h" #include "common.h" -#include <soci.h> #include <soci-platform.h> #include <ciso646> #include <limits> +#include <cstring> #ifdef _MSC_VER #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::MySQL; +using namespace soci; +using namespace soci::details; +using namespace soci::details::mysql; -void MySQLVectorUseTypeBackEnd::bindByPos(int &position, void *data, - eExchangeType type) +void mysql_vector_use_type_backend::bind_by_pos(int &position, void *data, + exchange_type type) { data_ = data; type_ = type; position_ = position++; } -void MySQLVectorUseTypeBackEnd::bindByName( - std::string const &name, void *data, eExchangeType type) +void mysql_vector_use_type_backend::bind_by_name( + std::string const &name, void *data, exchange_type type) { data_ = data; type_ = type; name_ = name; } -void MySQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) +void mysql_vector_use_type_backend::pre_use(indicator const *ind) { std::size_t const vsize = size(); for (size_t i = 0; i != vsize; ++i) { char *buf; - // the data in vector can be either eOK or eNull - if (ind != NULL && ind[i] == eNull) + // the data in vector can be either i_ok or i_null + if (ind != NULL && ind[i] == i_null) { buf = new char[5]; - strcpy(buf, "NULL"); + std::strcpy(buf, "NULL"); } else { // allocate and fill the buffer with text-formatted client data switch (type_) { - case eXChar: + case x_char: { std::vector<char> *pv = static_cast<std::vector<char> *>(data_); std::vector<char> &v = *pv; - + char tmp[] = { v[i], '\0' }; buf = quote(statement_.session_.conn_, tmp, 1); } break; - case eXStdString: + case x_stdstring: { std::vector<std::string> *pv = static_cast<std::vector<std::string> *>(data_); std::vector<std::string> &v = *pv; - + buf = quote(statement_.session_.conn_, v[i].c_str(), v[i].size()); } break; - case eXShort: + case x_short: { std::vector<short> *pv = static_cast<std::vector<short> *>(data_); @@ -89,7 +89,7 @@ void MySQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf, bufSize, "%d", static_cast<int>(v[i])); } break; - case eXInteger: + case x_integer: { std::vector<int> *pv = static_cast<std::vector<int> *>(data_); @@ -101,7 +101,7 @@ void MySQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf, bufSize, "%d", v[i]); } break; - case eXUnsignedLong: + case x_unsigned_long: { std::vector<unsigned long> *pv = static_cast<std::vector<unsigned long> *>(data_); @@ -113,7 +113,19 @@ void MySQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf, bufSize, "%lu", v[i]); } break; - case eXDouble: + case x_long_long: + { + std::vector<long long> *pv + = static_cast<std::vector<long long> *>(data_); + std::vector<long long> &v = *pv; + + std::size_t const bufSize + = std::numeric_limits<long long>::digits10 + 3; + buf = new char[bufSize]; + snprintf(buf, bufSize, "%lld", v[i]); + } + break; + case x_double: { // no need to overengineer it (KISS)... @@ -127,7 +139,7 @@ void MySQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf, bufSize, "%.20g", v[i]); } break; - case eXStdTm: + case x_stdtm: { std::vector<std::tm> *pv = static_cast<std::vector<std::tm> *>(data_); @@ -143,7 +155,7 @@ void MySQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) break; default: - throw SOCIError( + throw soci_error( "Use vector element used with non-supported type."); } } @@ -163,28 +175,29 @@ void MySQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) } } -std::size_t MySQLVectorUseTypeBackEnd::size() +std::size_t mysql_vector_use_type_backend::size() { std::size_t sz = 0; // dummy initialization to please the compiler switch (type_) { // simple cases - case eXChar: sz = getVectorSize<char> (data_); break; - case eXShort: sz = getVectorSize<short> (data_); break; - case eXInteger: sz = getVectorSize<int> (data_); break; - case eXUnsignedLong: sz = getVectorSize<unsigned long>(data_); break; - case eXDouble: sz = getVectorSize<double> (data_); break; - case eXStdString: sz = getVectorSize<std::string> (data_); break; - case eXStdTm: sz = getVectorSize<std::tm> (data_); break; + case x_char: sz = get_vector_size<char> (data_); break; + case x_short: sz = get_vector_size<short> (data_); break; + case x_integer: sz = get_vector_size<int> (data_); break; + case x_unsigned_long: sz = get_vector_size<unsigned long>(data_); break; + case x_long_long: sz = get_vector_size<long long> (data_); break; + case x_double: sz = get_vector_size<double> (data_); break; + case x_stdstring: sz = get_vector_size<std::string> (data_); break; + case x_stdtm: sz = get_vector_size<std::tm> (data_); break; default: - throw SOCIError("Use vector element used with non-supported type."); + throw soci_error("Use vector element used with non-supported type."); } return sz; } -void MySQLVectorUseTypeBackEnd::cleanUp() +void mysql_vector_use_type_backend::clean_up() { std::size_t const bsize = buffers_.size(); for (std::size_t i = 0; i != bsize; ++i) @@ -192,4 +205,3 @@ void MySQLVectorUseTypeBackEnd::cleanUp() delete [] buffers_[i]; } } - diff --git a/src/backends/odbc/Makefile.am b/src/backends/odbc/Makefile.am deleted file mode 100644 index 973849f6..00000000 --- a/src/backends/odbc/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# $Id: Makefile.am,v 1.1 2006/11/27 09:57:01 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -SOURCE = \ - soci-odbc.h \ - utility.h \ - blob.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -EXTRA_DIST = \ - $(SOURCE) \ - Makefile.basic - - diff --git a/src/backends/odbc/Makefile.basic b/src/backends/odbc/Makefile.basic deleted file mode 100644 index 9a1ab16f..00000000 --- a/src/backends/odbc/Makefile.basic +++ /dev/null @@ -1,89 +0,0 @@ -# The following variable is specific to this backend and its correct -# values might depend on your environment - feel free to set it accordingly. - -ODBCINCLUDEDIR = -I/usr/include - -# The rest of the Makefile is indepentent of the target environment. - -COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -CXXFLAGSSO = ${CXXFLAGS} -fPIC -INCLUDEDIRS = -I../../core ${ODBCINCLUDEDIR} - - -OBJECTS = blob.o factory.o row-id.o session.o standard-into-type.o \ - standard-use-type.o statement.o vector-into-type.o vector-use-type.o - -OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ - standard-into-type-s.o standard-use-type-s.o statement-s.o \ - vector-into-type-s.o vector-use-type-s.o - - -libsoci-odbc.a : ${OBJECTS} - ar rv $@ $? - ranlib $@ - rm *.o - - -blob.o : blob.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -factory.o : factory.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -row-id.o : row-id.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -session.o : session.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -standard-into-type.o : standard-into-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -standard-use-type.o : standard-use-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -statement.o : statement.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -vector-into-type.o : vector-into-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -vector-use-type.o : vector-use-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - - -shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci-odbc.so ${OBJECTSSO} - rm *.o - -blob-s.o : blob.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -factory-s.o : factory.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -row-id-s.o : row-id.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -session-s.o : session.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -standard-into-type-s.o : standard-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -standard-use-type-s.o : standard-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -statement-s.o : statement.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -vector-into-type-s.o : vector-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -vector-use-type-s.o : vector-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - - -clean : - rm -f libsoci-odbc.a libsoci-odbc.so diff --git a/src/backends/odbc/Makefile.in b/src/backends/odbc/Makefile.in deleted file mode 100644 index 8b03ab87..00000000 --- a/src/backends/odbc/Makefile.in +++ /dev/null @@ -1,371 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends/odbc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.1 2006/11/27 09:57:01 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -SOURCE = \ - soci-odbc.h \ - utility.h \ - blob.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -EXTRA_DIST = \ - $(SOURCE) \ - Makefile.basic - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/odbc/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/odbc/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -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: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/odbc/blob.cpp b/src/backends/odbc/blob.cpp deleted file mode 100644 index 8df6607b..00000000 --- a/src/backends/odbc/blob.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> - -using namespace SOCI; -using namespace SOCI::details; - - -ODBCBLOBBackEnd::ODBCBLOBBackEnd(ODBCSessionBackEnd &session) - : session_(session) -{ - // ... -} - -ODBCBLOBBackEnd::~ODBCBLOBBackEnd() -{ - // ... -} - -std::size_t ODBCBLOBBackEnd::getLen() -{ - // ... - return 0; -} - -std::size_t ODBCBLOBBackEnd::read( - std::size_t /* offset */, char * /* buf */, std::size_t /* toRead */) -{ - // ... - return 0; -} - -std::size_t ODBCBLOBBackEnd::write( - std::size_t /* offset */, char const * /* buf */, - std::size_t /* toWrite */) -{ - // ... - return 0; -} - -std::size_t ODBCBLOBBackEnd::append( - char const * /* buf */, std::size_t /* toWrite */) -{ - // ... - return 0; -} - -void ODBCBLOBBackEnd::trim(std::size_t /* newLen */) -{ - // ... -} diff --git a/src/backends/odbc/factory.cpp b/src/backends/odbc/factory.cpp deleted file mode 100644 index 10fa175c..00000000 --- a/src/backends/odbc/factory.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> - -using namespace SOCI; -using namespace SOCI::details; - - -// concrete factory for ODBC concrete strategies -ODBCSessionBackEnd * ODBCBackEndFactory::makeSession( - std::string const &connectString) const -{ - return new ODBCSessionBackEnd(connectString); -} - -ODBCBackEndFactory const SOCI::odbc; diff --git a/src/backends/odbc/row-id.cpp b/src/backends/odbc/row-id.cpp deleted file mode 100644 index c6145438..00000000 --- a/src/backends/odbc/row-id.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> - -using namespace SOCI; -using namespace SOCI::details; - - -ODBCRowIDBackEnd::ODBCRowIDBackEnd(ODBCSessionBackEnd & /* session */) -{ - // ... -} - -ODBCRowIDBackEnd::~ODBCRowIDBackEnd() -{ - // ... -} diff --git a/src/backends/odbc/session.cpp b/src/backends/odbc/session.cpp deleted file mode 100644 index 86e58b97..00000000 --- a/src/backends/odbc/session.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> - -using namespace SOCI; -using namespace SOCI::details; - -ODBCSessionBackEnd::ODBCSessionBackEnd(std::string const & connectString) - : henv_(0), hdbc_(0) -{ - SQLRETURN rc; - - // Allocate environment handle - rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv_); - if (is_odbc_error(rc)) - { - throw SOCIError("Unable to get environment handle"); - } - - // Set the ODBC version environment attribute - rc = SQLSetEnvAttr(henv_, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_ENV, henv_, - "Setting ODBC version"); - } - - // Allocate connection handle - rc = SQLAllocHandle(SQL_HANDLE_DBC, henv_, &hdbc_); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, hdbc_, - "Allocating connection handle"); - } - - SQLCHAR outConnString[1024]; - SQLSMALLINT strLength; - - rc = SQLDriverConnect(hdbc_, NULL, // windows handle - (SQLCHAR *)connectString.c_str(), - (SQLSMALLINT)connectString.size(), - outConnString, 1024, - &strLength, SQL_DRIVER_NOPROMPT); - - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, hdbc_, - "Error Connecting to database"); - } - - reset_transaction(); -} - -ODBCSessionBackEnd::~ODBCSessionBackEnd() -{ - cleanUp(); -} - -void ODBCSessionBackEnd::begin() -{ - SQLRETURN rc = SQLSetConnectAttr( hdbc_, SQL_ATTR_AUTOCOMMIT, - (SQLPOINTER)SQL_AUTOCOMMIT_OFF, 0 ); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, hdbc_, - "Begin Transaction"); - } -} - -void ODBCSessionBackEnd::commit() -{ - SQLRETURN rc = SQLEndTran(SQL_HANDLE_DBC, hdbc_, SQL_COMMIT); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, hdbc_, - "Commiting"); - } - reset_transaction(); -} - -void ODBCSessionBackEnd::rollback() -{ - SQLRETURN rc = SQLEndTran(SQL_HANDLE_DBC, hdbc_, SQL_ROLLBACK); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, hdbc_, - "Rolling back"); - } - reset_transaction(); -} - -void ODBCSessionBackEnd::reset_transaction() -{ - SQLRETURN rc = SQLSetConnectAttr( hdbc_, SQL_ATTR_AUTOCOMMIT, - (SQLPOINTER)SQL_AUTOCOMMIT_ON, 0 ); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, hdbc_, - "Set Auto Commit"); - } -} - - -void ODBCSessionBackEnd::cleanUp() -{ - SQLRETURN rc = SQLDisconnect(hdbc_); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, hdbc_, - "SQLDisconnect"); - } - - rc = SQLFreeHandle(SQL_HANDLE_DBC, hdbc_); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, hdbc_, - "SQLFreeHandle DBC"); - } - - rc = SQLFreeHandle(SQL_HANDLE_ENV, henv_); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_ENV, henv_, - "SQLFreeHandle ENV"); - } -} - -ODBCStatementBackEnd * ODBCSessionBackEnd::makeStatementBackEnd() -{ - return new ODBCStatementBackEnd(*this); -} - -ODBCRowIDBackEnd * ODBCSessionBackEnd::makeRowIDBackEnd() -{ - return new ODBCRowIDBackEnd(*this); -} - -ODBCBLOBBackEnd * ODBCSessionBackEnd::makeBLOBBackEnd() -{ - return new ODBCBLOBBackEnd(*this); -} diff --git a/src/backends/odbc/soci-odbc.h b/src/backends/odbc/soci-odbc.h deleted file mode 100644 index 7d9d6cc2..00000000 --- a/src/backends/odbc/soci-odbc.h +++ /dev/null @@ -1,298 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef SOCI_ODBC_H_INCLUDED -#define SOCI_ODBC_H_INCLUDED - -#ifdef _WIN32 -# ifdef SOCI_DLL -# ifdef SOCI_ODBC_SOURCE -# define SOCI_ODBC_DECL __declspec(dllexport) -# else -# define SOCI_ODBC_DECL __declspec(dllimport) -# endif // SOCI_ODBC_SOURCE -# endif // SOCI_DLL -#endif // _WIN32 -// -// If SOCI_ODBC_DECL isn't defined yet define it now -#ifndef SOCI_ODBC_DECL -# define SOCI_ODBC_DECL -#endif - -#include <soci-backend.h> -#ifdef _MSC_VER -#include <windows.h> -#endif -#include <sqlext.h> // ODBC -#include <vector> - -namespace SOCI -{ - -struct ODBCStatementBackEnd; -struct ODBCStandardIntoTypeBackEnd : details::StandardIntoTypeBackEnd -{ - ODBCStandardIntoTypeBackEnd(ODBCStatementBackEnd &st) - : statement_(st), buf_(0) - {} - - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); - - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind); - - virtual void cleanUp(); - - ODBCStatementBackEnd &statement_; - char *buf_; // generic buffer - void *data_; - details::eExchangeType type_; - int position_; - SQLSMALLINT odbcType_; - SQLINTEGER valueLen_; -}; - -struct ODBCVectorIntoTypeBackEnd : details::VectorIntoTypeBackEnd -{ - ODBCVectorIntoTypeBackEnd(ODBCStatementBackEnd &st) - : statement_(st), indHolders_(NULL), - data_(NULL), buf_(NULL) {} - - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); - - virtual void preFetch(); - virtual void postFetch(bool gotData, eIndicator *ind); - - virtual void resize(std::size_t sz); - virtual std::size_t size(); - - virtual void cleanUp(); - - // helper function for preparing indicators - // (as part of the defineByPos) - void prepareIndicators(std::size_t size); - - ODBCStatementBackEnd &statement_; - - SQLLEN *indHolders_; - std::vector<SQLINTEGER> indHolderVec_; - void *data_; - char *buf_; // generic buffer - details::eExchangeType type_; - std::size_t colSize_; // size of the string column (used for strings) - SQLSMALLINT odbcType_; -}; - -struct ODBCStandardUseTypeBackEnd : details::StandardUseTypeBackEnd -{ - ODBCStandardUseTypeBackEnd(ODBCStatementBackEnd &st) - : statement_(st), data_(0), buf_(0), indHolder_(0) {} - - void prepareForBind(void *&data, SQLUINTEGER &size, - SQLSMALLINT &sqlType, SQLSMALLINT &cType); - void bindHelper(int &position, - void *data, details::eExchangeType type); - - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); - - virtual void preUse(eIndicator const *ind); - virtual void postUse(bool gotData, eIndicator *ind); - - virtual void cleanUp(); - - ODBCStatementBackEnd &statement_; - void *data_; - details::eExchangeType type_; - char *buf_; - SQLINTEGER indHolder_; -}; - -struct ODBCVectorUseTypeBackEnd : details::VectorUseTypeBackEnd -{ - ODBCVectorUseTypeBackEnd(ODBCStatementBackEnd &st) - : statement_(st), indHolders_(NULL), - data_(NULL), buf_(NULL) {} - - // helper function for preparing indicators - // (as part of the defineByPos) - void prepareIndicators(std::size_t size); - - // common part for bindByPos and bindByName - void prepareForBind(void *&data, SQLUINTEGER &size, SQLSMALLINT &sqlType, SQLSMALLINT &cType); - void bindHelper(int &position, - void *data, details::eExchangeType type); - - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); - - virtual void preUse(eIndicator const *ind); - - virtual std::size_t size(); - - virtual void cleanUp(); - - ODBCStatementBackEnd &statement_; - - SQLLEN *indHolders_; - std::vector<SQLLEN> indHolderVec_; - void *data_; - details::eExchangeType type_; - char *buf_; // generic buffer - std::size_t colSize_; // size of the string column (used for strings) - // used for strings only - std::size_t maxSize_; -}; - -struct ODBCSessionBackEnd; -struct ODBCStatementBackEnd : details::StatementBackEnd -{ - ODBCStatementBackEnd(ODBCSessionBackEnd &session); - - virtual void alloc(); - virtual void cleanUp(); - virtual void prepare(std::string const &query, - details::eStatementType eType); - - virtual execFetchResult execute(int number); - virtual execFetchResult fetch(int number); - - virtual int getNumberOfRows(); - - virtual std::string rewriteForProcedureCall(std::string const &query); - - virtual int prepareForDescribe(); - virtual void describeColumn(int colNum, eDataType &dtype, - std::string &columnName); - - // helper for defining into vector<string> - std::size_t columnSize(int position); - - virtual ODBCStandardIntoTypeBackEnd * makeIntoTypeBackEnd(); - virtual ODBCStandardUseTypeBackEnd * makeUseTypeBackEnd(); - virtual ODBCVectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd(); - virtual ODBCVectorUseTypeBackEnd * makeVectorUseTypeBackEnd(); - - ODBCSessionBackEnd &session_; - SQLHSTMT hstmt_; - SQLUINTEGER numRowsFetched_; - bool hasVectorUseElements_; - bool boundByName_; - bool boundByPos_; - - std::string query_; - std::vector<std::string> names_; // list of names for named binds - -}; - -struct ODBCRowIDBackEnd : details::RowIDBackEnd -{ - ODBCRowIDBackEnd(ODBCSessionBackEnd &session); - - ~ODBCRowIDBackEnd(); -}; - -struct ODBCBLOBBackEnd : details::BLOBBackEnd -{ - ODBCBLOBBackEnd(ODBCSessionBackEnd &session); - - ~ODBCBLOBBackEnd(); - - virtual std::size_t getLen(); - virtual std::size_t read(std::size_t offset, char *buf, - std::size_t toRead); - virtual std::size_t write(std::size_t offset, char const *buf, - std::size_t toWrite); - virtual std::size_t append(char const *buf, std::size_t toWrite); - virtual void trim(std::size_t newLen); - - ODBCSessionBackEnd &session_; -}; - -struct ODBCSessionBackEnd : details::SessionBackEnd -{ - ODBCSessionBackEnd(std::string const &connectString); - - ~ODBCSessionBackEnd(); - - virtual void begin(); - virtual void commit(); - virtual void rollback(); - - void reset_transaction(); - - void cleanUp(); - - virtual ODBCStatementBackEnd * makeStatementBackEnd(); - virtual ODBCRowIDBackEnd * makeRowIDBackEnd(); - virtual ODBCBLOBBackEnd * makeBLOBBackEnd(); - - SQLHENV henv_; - SQLHDBC hdbc_; -}; - -struct ODBCBackEndFactory : BackEndFactory -{ - virtual ODBCSessionBackEnd * makeSession( - std::string const &connectString) const; -}; - -SOCI_ODBC_DECL extern ODBCBackEndFactory const odbc; - -class SOCI_ODBC_DECL ODBCSOCIError : public SOCIError -{ - SQLCHAR message_[SQL_MAX_MESSAGE_LENGTH + 1]; - SQLCHAR sqlstate_[SQL_SQLSTATE_SIZE + 1]; - SQLINTEGER sqlcode_; - -public: - ODBCSOCIError(SQLSMALLINT htype, - SQLHANDLE hndl, - std::string const & msg) - : SOCIError(msg) - { - SQLSMALLINT length, i = 1; - SQLGetDiagRec(htype, hndl, i, sqlstate_, &sqlcode_, - message_, SQL_MAX_MESSAGE_LENGTH + 1, - &length); - - } - - SQLCHAR const * odbcErrorCode() const - { - return reinterpret_cast<SQLCHAR const *>(sqlstate_); - } - SQLINTEGER nativeErrorCode() const - { - return sqlcode_; - } - SQLCHAR const * odbcErrorMessage() const - { - return reinterpret_cast<SQLCHAR const *>(message_); - } -}; - -inline bool is_odbc_error(SQLRETURN rc) -{ - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) - return true; - else - return false; -} - -} // namespace SOCI - - -#endif // SOCI_EMPTY_H_INCLUDED - diff --git a/src/backends/odbc/standard-into-type.cpp b/src/backends/odbc/standard-into-type.cpp deleted file mode 100644 index 64363cdd..00000000 --- a/src/backends/odbc/standard-into-type.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> - -using namespace SOCI; -using namespace SOCI::details; - - -void ODBCStandardIntoTypeBackEnd::defineByPos( - int & position , void * data, eExchangeType type) -{ - data_ = data; - type_ = type; - position_ = position++; - - SQLINTEGER size = 0; - - switch (type_) - { - case eXChar: - odbcType_ = SQL_C_CHAR; - size = sizeof(char) + 1; - buf_ = new char[size]; - data = buf_; - break; - case eXCString: - { - details::CStringDescriptor *desc = static_cast<CStringDescriptor *>(data); - odbcType_ = SQL_C_CHAR; - data = desc->str_; - size = static_cast<SQLINTEGER>(desc->bufSize_); - } - break; - case eXStdString: - odbcType_ = SQL_C_CHAR; - size = 4000; - buf_ = new char[size]+1; - data = buf_; - break; - case eXShort: - odbcType_ = SQL_C_SSHORT; - size = sizeof(short); - break; - case eXInteger: - odbcType_ = SQL_C_SLONG; - size = sizeof(long); - break; - case eXUnsignedLong: - odbcType_ = SQL_C_ULONG; - size = sizeof(unsigned long); - break; - case eXDouble: - odbcType_ = SQL_C_DOUBLE; - size = sizeof(double); - break; - case eXStdTm: - odbcType_ = SQL_C_TYPE_TIMESTAMP; - size = sizeof(TIMESTAMP_STRUCT); - buf_ = new char[size]; - data = buf_; - break; - case eXRowID: - odbcType_ = SQL_C_ULONG; - size = sizeof(unsigned long); - break; - default: - throw SOCIError("Into element used with non-supported type."); - } - - valueLen_ = 0; - - SQLRETURN rc = SQLBindCol(statement_.hstmt_, position_, odbcType_, data, size, &valueLen_); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, statement_.hstmt_, - "into type prefetch"); - } -} - -void ODBCStandardIntoTypeBackEnd::preFetch() -{ - //... -} - -void ODBCStandardIntoTypeBackEnd::postFetch( - bool gotData, bool calledFromFetch, eIndicator * ind) -{ - if (calledFromFetch == true && gotData == false) - { - // this is a normal end-of-rowset condition, - // no need to do anything (fetch() will return false) - return; - } - - if (gotData) - { - // first, deal with indicators - if (SQL_NULL_DATA == valueLen_) - { - if (ind == NULL) - { - throw SOCIError( - "Null value fetched and no indicator defined."); - } - - *ind = eNull; - return; - } - else - { - if (ind != NULL) - { - *ind = eOK; - } - } - - // only std::string and std::tm need special handling - if (type_ == eXChar) - { - char *c = static_cast<char*>(data_); - *c = buf_[0]; - } - if (type_ == eXCString) - { - if (ind != NULL) - { - details::CStringDescriptor *desc = static_cast<CStringDescriptor *>(data_); - int size = static_cast<SQLINTEGER>(desc->bufSize_); - if (size < valueLen_) - *ind = eTruncated; - } - } - if (type_ == eXStdString) - { - std::string *s = static_cast<std::string *>(data_); - *s = buf_; - } - else if (type_ == eXStdTm) - { - std::tm *t = static_cast<std::tm *>(data_); - - TIMESTAMP_STRUCT * ts = reinterpret_cast<TIMESTAMP_STRUCT*>(buf_); - t->tm_isdst = -1; - t->tm_year = ts->year - 1900; - t->tm_mon = ts->month - 1; - t->tm_mday = ts->day; - t->tm_hour = ts->hour; - t->tm_min = ts->minute; - t->tm_sec = ts->second; - - // normalize and compute the remaining fields - std::mktime(t); - } - } - else // no data retrieved - { - if (ind != NULL) - { - *ind = eNoData; - } - else - { - throw SOCIError("No data fetched and no indicator defined."); - } - } -} - -void ODBCStandardIntoTypeBackEnd::cleanUp() -{ - if (!buf_) - { - delete[] buf_; - buf_ = 0; - } -} diff --git a/src/backends/odbc/standard-use-type.cpp b/src/backends/odbc/standard-use-type.cpp deleted file mode 100644 index 34fab7f8..00000000 --- a/src/backends/odbc/standard-use-type.cpp +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> -#include <cctype> -#include <cstdio> -#include <cstring> -#include <ctime> -#include <sstream> - -using namespace SOCI; -using namespace SOCI::details; - -void ODBCStandardUseTypeBackEnd::prepareForBind( - void *&data, SQLUINTEGER &size, SQLSMALLINT &sqlType, SQLSMALLINT &cType) -{ - switch (type_) - { - // simple cases - case eXShort: - sqlType = SQL_SMALLINT; - cType = SQL_C_SSHORT; - size = sizeof(short); - break; - case eXInteger: - sqlType = SQL_INTEGER; - cType = SQL_C_SLONG; - size = sizeof(int); - break; - case eXUnsignedLong: - sqlType = SQL_BIGINT; - cType = SQL_C_ULONG; - size = sizeof(unsigned long); - break; - case eXDouble: - sqlType = SQL_DOUBLE; - cType = SQL_C_DOUBLE; - size = sizeof(double); - break; - - // cases that require adjustments and buffer management - case eXChar: - sqlType = SQL_CHAR; - cType = SQL_C_CHAR; - size = sizeof(char)+1; - buf_ = new char[size]; - data = buf_; - indHolder_ = SQL_NTS; - break; - case eXCString: - { - details::CStringDescriptor *desc = static_cast<CStringDescriptor *>(data); - sqlType = SQL_VARCHAR; - cType = SQL_C_CHAR; - data = desc->str_; - size = static_cast<SQLUINTEGER>(desc->bufSize_); - indHolder_ = SQL_NTS; - } - break; - case eXStdString: - { - std::string *s = static_cast<std::string *>(data); - sqlType = SQL_VARCHAR; - cType = SQL_C_CHAR; - size = 255; // !FIXME this is not sufficent - buf_ = new char[size]; - data = buf_; - indHolder_ = SQL_NTS; - } - break; - case eXStdTm: - sqlType = SQL_TIMESTAMP; - cType = SQL_C_TIMESTAMP; - buf_ = new char[sizeof(TIMESTAMP_STRUCT)]; - data = buf_; - size = 19; // This number is not the size in bytes, but the number - // of characters in the date if it was written out - // yyyy-mm-dd hh:mm:ss - break; - - case eXBLOB: - { -// sqlType = SQL_VARBINARY; -// cType = SQL_C_BINARY; - -// BLOB *b = static_cast<BLOB *>(data); - -// ODBCBLOBBackEnd *bbe -// = static_cast<ODBCBLOBBackEnd *>(b->getBackEnd()); - -// size = 0; -// indHolder_ = size; - //TODO data = &bbe->lobp_; - } - break; - case eXStatement: - case eXRowID: - break; - } -} - -void ODBCStandardUseTypeBackEnd::bindHelper(int &position, void *data, eExchangeType type) -{ - data_ = data; // for future reference - type_ = type; // for future reference - - SQLSMALLINT sqlType; - SQLSMALLINT cType; - SQLUINTEGER size; - - prepareForBind(data, size, sqlType, cType); - - SQLRETURN rc = SQLBindParameter(statement_.hstmt_, position++, SQL_PARAM_INPUT, - cType, sqlType, size, 0, data, 0, &indHolder_); - - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, statement_.hstmt_, - "Binding"); - } -} - -void ODBCStandardUseTypeBackEnd::bindByPos( - int &position, void *data, eExchangeType type) -{ - if (statement_.boundByName_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - bindHelper(position, data, type); - - statement_.boundByPos_ = true; -} - -void ODBCStandardUseTypeBackEnd::bindByName( - std::string const &name, void *data, eExchangeType type) -{ - if (statement_.boundByPos_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - int position = -1; - int count = 1; - - for (std::vector<std::string>::iterator it = statement_.names_.begin(); - it != statement_.names_.end(); ++it) - { - if (*it == name) - { - position = count; - break; - } - count++; - } - - if (position != -1) - bindHelper(position, data, type); - else - { - std::ostringstream ss; - ss << "Unable to find name '" << name << "' to bind to"; - throw SOCIError(ss.str().c_str()); - } - - statement_.boundByName_ = true; -} - -void ODBCStandardUseTypeBackEnd::preUse(eIndicator const *ind) -{ - // first deal with data - if (type_ == eXChar) - { - char *c = static_cast<char*>(data_); - buf_[0] = *c; - buf_[1] = '\0'; - } - else if (type_ == eXStdString) - { - std::string *s = static_cast<std::string *>(data_); - - std::size_t const bufSize = 4000; - std::size_t const sSize = s->size(); - std::size_t const toCopy = - sSize < bufSize -1 ? sSize + 1 : bufSize - 1; - strncpy(buf_, s->c_str(), toCopy); - buf_[toCopy] = '\0'; - } - else if (type_ == eXStdTm) - { - std::tm *t = static_cast<std::tm *>(data_); - TIMESTAMP_STRUCT * ts = reinterpret_cast<TIMESTAMP_STRUCT*>(buf_); - - ts->year = t->tm_year + 1900; - ts->month = t->tm_mon + 1; - ts->day = t->tm_mday; - ts->hour = t->tm_hour; - ts->minute = t->tm_min; - ts->second = t->tm_sec; - ts->fraction = 0; - } - - // then handle indicators - if (ind != NULL && *ind == eNull) - { - indHolder_ = SQL_NULL_DATA; // null - } -} - -void ODBCStandardUseTypeBackEnd::postUse(bool gotData, eIndicator *ind) -{ - // first, deal with data - if (gotData) - { - if (type_ == eXChar) - { - char *c = static_cast<char*>(data_); - *c = buf_[0]; - } - else if (type_ == eXStdString) - { - std::string *s = static_cast<std::string *>(data_); - - *s = buf_; - } - else if (type_ == eXStdTm) - { - std::tm *t = static_cast<std::tm *>(data_); - TIMESTAMP_STRUCT * ts = reinterpret_cast<TIMESTAMP_STRUCT*>(buf_); - t->tm_isdst = -1; - t->tm_year = ts->year - 1900; - t->tm_mon = ts->month - 1; - t->tm_mday = ts->day; - t->tm_hour = ts->hour; - t->tm_min = ts->minute; - t->tm_sec = ts->second; - - // normalize and compute the remaining fields - std::mktime(t); - } - } - - if (ind != NULL) - { - if (gotData == false) - { - *ind = eNoData; - } - else - { - if (indHolder_ == 0) - { - *ind = eOK; - } - else if (indHolder_ == SQL_NULL_DATA) - { - *ind = eNull; - } - else - { - *ind = eTruncated; - } - } - } - else - { - if (indHolder_ == SQL_NULL_DATA) - { - // fetched null and no indicator - programming error! - throw SOCIError("Null value fetched and no indicator defined."); - } - - if (gotData == false) - { - // no data fetched and no indicator - programming error! - throw SOCIError("No data fetched and no indicator defined."); - } - } -} - -void ODBCStandardUseTypeBackEnd::cleanUp() -{ - if (buf_ != NULL) - { - delete [] buf_; - buf_ = NULL; - } -} diff --git a/src/backends/odbc/statement.cpp b/src/backends/odbc/statement.cpp deleted file mode 100644 index 6ef31710..00000000 --- a/src/backends/odbc/statement.cpp +++ /dev/null @@ -1,310 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> -#include <cctype> - -#ifdef _MSC_VER -// disables the warning about converting int to void*. This is a 64 bit compatibility -// warning, but odbc requires the value to be converted on this line -// SQLSetStmtAttr(hstmt_, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)number, 0); -#pragma warning(disable:4312) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -ODBCStatementBackEnd::ODBCStatementBackEnd(ODBCSessionBackEnd &session) - : session_(session), hstmt_(0), numRowsFetched_(0) - , hasVectorUseElements_(false), boundByName_(false), boundByPos_(false) -{ -} - -void ODBCStatementBackEnd::alloc() -{ - SQLRETURN rc; - - // Allocate environment handle - rc = SQLAllocHandle(SQL_HANDLE_STMT, session_.hdbc_, &hstmt_); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_DBC, session_.hdbc_, - "Allocating statement"); - } -} - -void ODBCStatementBackEnd::cleanUp() -{ - SQLFreeHandle(SQL_HANDLE_STMT, hstmt_); -} - - -void ODBCStatementBackEnd::prepare(std::string const & query, - eStatementType /* eType */) -{ - // rewrite the query by transforming all named parameters into - // the ODBC numbers ones (:abc -> $1, etc.) - - enum { eNormal, eInQuotes, eInName, eInAccessDate } state = eNormal; - - std::string name; - - for (std::string::const_iterator it = query.begin(), end = query.end(); - it != end; ++it) - { - switch (state) - { - case eNormal: - if (*it == '\'') - { - query_ += *it; - state = eInQuotes; - } - else if (*it == '#') - { - query_ += *it; - state = eInAccessDate; - } - else if (*it == ':') - { - state = eInName; - } - else // regular character, stay in the same state - { - query_ += *it; - } - break; - case eInQuotes: - if (*it == '\'') - { - query_ += *it; - state = eNormal; - } - else // regular quoted character - { - query_ += *it; - } - break; - case eInName: - if (std::isalnum(*it) || *it == '_') - { - name += *it; - } - else // end of name - { - names_.push_back(name); - name.clear(); - std::ostringstream ss; - ss << '?'; - query_ += ss.str(); - query_ += *it; - state = eNormal; - } - break; - case eInAccessDate: - if (*it == '#') - { - query_ += *it; - state = eNormal; - } - else // regular quoted character - { - query_ += *it; - } - break; - } - } - - if (state == eInName) - { - names_.push_back(name); - std::ostringstream ss; - ss << '?'; - query_ += ss.str(); - } - - SQLRETURN rc = SQLPrepare(hstmt_, (SQLCHAR*)query_.c_str(), (SQLINTEGER)query_.size()); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, hstmt_, - query_.c_str()); - } -} - -StatementBackEnd::execFetchResult -ODBCStatementBackEnd::execute(int number) -{ - // made this static because MSVC debugger was reporting - // that there was an attempt to use rows_processed after the stack - // was destroyed. Some ODBC cleanup ? - static SQLUSMALLINT rows_processed = 0; - - if (hasVectorUseElements_) - { - SQLSetStmtAttr(hstmt_, SQL_ATTR_PARAMS_PROCESSED_PTR, &rows_processed, 0); - } - - // if we are called twice for the same statement we need to close the open - // cursor or an "invalid cursor state" error will occur on execute - SQLCloseCursor(hstmt_); - - SQLRETURN rc = SQLExecute(hstmt_); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, hstmt_, - "Statement Execute"); - } - - SQLSMALLINT colCount; - SQLNumResultCols(hstmt_, &colCount); - - if (number > 0 && colCount > 0) - return fetch(number); - - return eSuccess; -} - -StatementBackEnd::execFetchResult -ODBCStatementBackEnd::fetch(int number) -{ - numRowsFetched_ = 0; - - SQLSetStmtAttr(hstmt_, SQL_ATTR_ROW_BIND_TYPE, SQL_BIND_BY_COLUMN, 0); - SQLSetStmtAttr(hstmt_, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)number, 0); - SQLSetStmtAttr(hstmt_, SQL_ATTR_ROWS_FETCHED_PTR, &numRowsFetched_, 0); - - SQLRETURN rc = SQLFetch(hstmt_); - - if (SQL_NO_DATA == rc) - return eNoData; - - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, hstmt_, - "Statement Fetch"); - } - - return eSuccess; -} - -int ODBCStatementBackEnd::getNumberOfRows() -{ - return numRowsFetched_; -} - -std::string ODBCStatementBackEnd::rewriteForProcedureCall( - std::string const &query) -{ - return query; -} - -int ODBCStatementBackEnd::prepareForDescribe() -{ - SQLSMALLINT numCols; - SQLNumResultCols(hstmt_, &numCols); - return numCols; -} - -void ODBCStatementBackEnd::describeColumn(int colNum, eDataType & type, - std::string & columnName) -{ - SQLCHAR colNameBuffer[2048]; - SQLSMALLINT colNameBufferOverflow; - SQLSMALLINT dataType; - SQLUINTEGER colSize; - SQLSMALLINT decDigits; - SQLSMALLINT isNullable; - - SQLRETURN rc = SQLDescribeCol(hstmt_, colNum, colNameBuffer, 2048, - &colNameBufferOverflow, &dataType, - &colSize, &decDigits, &isNullable); - - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, hstmt_, - "describe Column"); - } - - char const *name = reinterpret_cast<char const *>(colNameBuffer); - columnName.assign(name, std::strlen(name)); - - switch (dataType) - { - case SQL_TYPE_DATE: - case SQL_TYPE_TIME: - case SQL_TYPE_TIMESTAMP: - type = eDate; - break; - case SQL_DOUBLE: - case SQL_DECIMAL: - case SQL_REAL: - case SQL_FLOAT: - case SQL_NUMERIC: - type = eDouble; - break; - case SQL_TINYINT: - case SQL_SMALLINT: - case SQL_INTEGER: - case SQL_BIGINT: - type = eInteger; - break; - case SQL_CHAR: - case SQL_VARCHAR: - default: - type = eString; - break; - } -} - -std::size_t ODBCStatementBackEnd::columnSize(int colNum) -{ - SQLCHAR colNameBuffer[2048]; - SQLSMALLINT colNameBufferOverflow; - SQLSMALLINT dataType; - SQLUINTEGER colSize; - SQLSMALLINT decDigits; - SQLSMALLINT isNullable; - - SQLRETURN rc = SQLDescribeCol(hstmt_, colNum, colNameBuffer, 2048, - &colNameBufferOverflow, &dataType, - &colSize, &decDigits, &isNullable); - - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, hstmt_, - "column size"); - } - - return colSize; -} - - - -ODBCStandardIntoTypeBackEnd * ODBCStatementBackEnd::makeIntoTypeBackEnd() -{ - return new ODBCStandardIntoTypeBackEnd(*this); -} - -ODBCStandardUseTypeBackEnd * ODBCStatementBackEnd::makeUseTypeBackEnd() -{ - return new ODBCStandardUseTypeBackEnd(*this); -} - -ODBCVectorIntoTypeBackEnd * -ODBCStatementBackEnd::makeVectorIntoTypeBackEnd() -{ - return new ODBCVectorIntoTypeBackEnd(*this); -} - -ODBCVectorUseTypeBackEnd * ODBCStatementBackEnd::makeVectorUseTypeBackEnd() -{ - hasVectorUseElements_ = true; - return new ODBCVectorUseTypeBackEnd(*this); -} diff --git a/src/backends/odbc/test/Makefile.am b/src/backends/odbc/test/Makefile.am deleted file mode 100644 index de3a6dcd..00000000 --- a/src/backends/odbc/test/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -# $Id: Makefile.am,v 1.1 2006/11/27 09:57:01 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# - -SOURCE = \ - test-odbc-access.cpp \ - test-odbc-mssql.cpp \ - test-odbc-mysql.cpp \ - test-odbc-postgresql.cpp - - -EXTRA_DIST = \ - $(SOURCE) \ - Makefile.basic \ - test-access.dsn \ - test-mssql.dsn \ - test-mysql.dsn \ - test-postgresql.dsn - diff --git a/src/backends/odbc/test/Makefile.basic b/src/backends/odbc/test/Makefile.basic deleted file mode 100644 index 94f9f28e..00000000 --- a/src/backends/odbc/test/Makefile.basic +++ /dev/null @@ -1,24 +0,0 @@ -# The following variable is specific to this backend and its correct -# values might depend on your environment - feel free to set it accordingly. - -ODBCINCLUDEDIR = -I/usr/include -ODBCLIBDIR = -L/usr/lib -ODBCLIBS = -lodbc -lodbcinst - -# The rest of the Makefile is independent of the target environment. - -COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -INCLUDEDIRS = -I.. -I../../../core ${ODBCINCLUDEDIR} -LIBDIRS = -L.. -L../../../core ${ODBCLIBDIR} -LIBS = -lsoci-core -lsoci-odbc ${ODBCLIBS} - - -test-odbc-mssql: test-odbc-mssql.cpp - ${COMPILER} -o $@ $? ${CXXFLAGS} ${INCLUDEDIRS} ${LIBDIRS} ${LIBS} - -test-odbc-access: test-odbc-access.cpp - ${COMPILER} -o $@ $? ${CXXFLAGS} ${INCLUDEDIRS} ${LIBDIRS} ${LIBS} - -clean : - rm -f test-odbc-access.exe test-odbc-mssql.exe diff --git a/src/backends/odbc/test/Makefile.in b/src/backends/odbc/test/Makefile.in deleted file mode 100644 index d101039e..00000000 --- a/src/backends/odbc/test/Makefile.in +++ /dev/null @@ -1,368 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# $Id: Makefile.am,v 1.1 2006/11/27 09:57:01 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends/odbc/test -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -SOURCE = \ - test-odbc-access.cpp \ - test-odbc-mssql.cpp \ - test-odbc-mysql.cpp \ - test-odbc-postgresql.cpp - -EXTRA_DIST = \ - $(SOURCE) \ - Makefile.basic \ - test-access.dsn \ - test-mssql.dsn \ - test-mysql.dsn \ - test-postgresql.dsn - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/odbc/test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/odbc/test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -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: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/odbc/test/test-access.dsn b/src/backends/odbc/test/test-access.dsn deleted file mode 100644 index c40954f9..00000000 --- a/src/backends/odbc/test/test-access.dsn +++ /dev/null @@ -1,13 +0,0 @@ -[ODBC] -DRIVER=Microsoft Access Driver (*.mdb) -UID=admin -UserCommitSync=Yes -Threads=3 -SafeTransactions=0 -PageTimeout=5 -MaxScanRows=8 -MaxBufferSize=2048 -FIL=MS Access -DriverId=25 -DefaultDir=.\ -DBQ=.\soci.mdb diff --git a/src/backends/odbc/test/test-mssql.dsn b/src/backends/odbc/test/test-mssql.dsn deleted file mode 100644 index 5fcf7c0f..00000000 --- a/src/backends/odbc/test/test-mssql.dsn +++ /dev/null @@ -1,8 +0,0 @@ -[ODBC] -DRIVER=SQL Native Client -UID=David -DATABASE=socitest -WSID=NANO -APP=Microsoft Data Access Components -Trusted_Connection=Yes -SERVER=localhost\SQLEXPRESS diff --git a/src/backends/odbc/test/test-mysql.dsn b/src/backends/odbc/test/test-mysql.dsn deleted file mode 100644 index c85b27c4..00000000 --- a/src/backends/odbc/test/test-mysql.dsn +++ /dev/null @@ -1,6 +0,0 @@ -[ODBC] -DRIVER=MySQL ODBC 3.51 Driver -DATABASE=socitest -USER=root -PORT=0 -OPTION=0 diff --git a/src/backends/odbc/test/test-odbc-access.cpp b/src/backends/odbc/test/test-odbc-access.cpp deleted file mode 100644 index ae2f038c..00000000 --- a/src/backends/odbc/test/test-odbc-access.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "soci.h" -#include "soci-odbc.h" -#include "common-tests.h" -#include <iostream> -#include <string> -#include <cassert> -#include <ctime> -#include <cmath> - -using namespace SOCI; -using namespace SOCI::tests; - -std::string connectString; -BackEndFactory const &backEnd = odbc; - - -// DDL Creation objects for common tests -struct TableCreator1 : public TableCreatorBase -{ - TableCreator1(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(id integer, val integer, c char, " - "str varchar(20), sh integer, ul number, d float, " - "tm timestamp, i1 integer, i2 integer, i3 integer, " - "name varchar(20))"; - } -}; - -struct TableCreator2 : public TableCreatorBase -{ - TableCreator2(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(num_float float, num_int integer," - " name varchar(20), sometime datetime, chr char)"; - } -}; - -struct TableCreator3 : public TableCreatorBase -{ - TableCreator3(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(name varchar(100) not null, " - "phone varchar(15))"; - } -}; - -// -// Support for SOCI Common Tests -// - -class TestContext : public TestContextBase -{ -public: - TestContext(BackEndFactory const &backEnd, - std::string const &connectString) - : TestContextBase(backEnd, connectString) {} - - TableCreatorBase* tableCreator1(Session& s) const - { - return new TableCreator1(s); - } - - TableCreatorBase* tableCreator2(Session& s) const - { - return new TableCreator2(s); - } - - TableCreatorBase* tableCreator3(Session& s) const - { - return new TableCreator3(s); - } - - std::string fromDual (std::string const &sql) const - { - return sql; - } - - std::string toDate(std::string const &dateString) const - { - return "#" + dateString + "#"; - } - - std::string toDateTime(std::string const &dateString) const - { - return "#" + dateString + "#"; - } -}; - -int main(int argc, char** argv) -{ - -#ifdef _MSC_VER - // Redirect errors, unrecoverable problems, and assert() failures to STDERR, - // instead of debug message window. - // This hack is required to run asser()-driven tests by Buildbot. - // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside. - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); -#endif //_MSC_VER - - if (argc == 2) - { - connectString = argv[1]; - } - else - { - connectString = "FILEDSN=./test-access.dsn"; - } - try - { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); - tests.run(); - } - catch (SOCI::ODBCSOCIError const & e) - { - std::cout << "ODBC Error Code: " << e.odbcErrorCode() << std::endl - << "Native Error Code: " << e.nativeErrorCode() << std::endl - << "SOCI Message: " << e.what() << std::endl - << "ODBC Message: " << e.odbcErrorMessage() << std::endl; - } - catch (std::exception const & e) - { - std::cout << "STD::EXECEPTION " << e.what() << '\n'; - } -} diff --git a/src/backends/odbc/test/test-odbc-mssql.cpp b/src/backends/odbc/test/test-odbc-mssql.cpp deleted file mode 100644 index 99fad929..00000000 --- a/src/backends/odbc/test/test-odbc-mssql.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "soci.h" -#include "soci-odbc.h" -#include "common-tests.h" -#include <iostream> -#include <string> -#include <cassert> -#include <ctime> -#include <cmath> - -using namespace SOCI; -using namespace SOCI::tests; - -std::string connectString; -BackEndFactory const &backEnd = odbc; - - -// DDL Creation objects for common tests -struct TableCreator1 : public TableCreatorBase -{ - TableCreator1(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(id integer, val integer, c char, " - "str varchar(20), sh smallint, ul numeric(20), d float, " - "tm datetime, i1 integer, i2 integer, i3 integer, " - "name varchar(20))"; - } -}; - -struct TableCreator2 : public TableCreatorBase -{ - TableCreator2(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(num_float float, num_int integer," - " name varchar(20), sometime datetime, chr char)"; - } -}; - -struct TableCreator3 : public TableCreatorBase -{ - TableCreator3(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(name varchar(100) not null, " - "phone varchar(15))"; - } -}; - -// -// Support for SOCI Common Tests -// - -class TestContext : public TestContextBase -{ -public: - TestContext(BackEndFactory const &backEnd, - std::string const &connectString) - : TestContextBase(backEnd, connectString) {} - - TableCreatorBase* tableCreator1(Session& s) const - { - return new TableCreator1(s); - } - - TableCreatorBase* tableCreator2(Session& s) const - { - return new TableCreator2(s); - } - - TableCreatorBase* tableCreator3(Session& s) const - { - return new TableCreator3(s); - } - - std::string toDateTime(std::string const &dateString) const - { - return "convert(datetime, \'" + dateString + "\', 120)"; - } -}; - -int main(int argc, char** argv) -{ - -#ifdef _MSC_VER - // Redirect errors, unrecoverable problems, and assert() failures to STDERR, - // instead of debug message window. - // This hack is required to run asser()-driven tests by Buildbot. - // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside. - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); -#endif //_MSC_VER - - if (argc == 2) - { - connectString = argv[1]; - } - else - { - connectString = "FILEDSN=./test-mssql.dsn"; - } - try - { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); - tests.run(); - } - catch (SOCI::ODBCSOCIError const & e) - { - std::cout << "ODBC Error Code: " << e.odbcErrorCode() << std::endl - << "Native Error Code: " << e.nativeErrorCode() << std::endl - << "SOCI Message: " << e.what() << std::endl - << "ODBC Message: " << e.odbcErrorMessage() << std::endl; - } - catch (std::exception const & e) - { - std::cout << "STD::EXECEPTION " << e.what() << '\n'; - } -} diff --git a/src/backends/odbc/test/test-odbc-mysql.cpp b/src/backends/odbc/test/test-odbc-mysql.cpp deleted file mode 100644 index e16678fb..00000000 --- a/src/backends/odbc/test/test-odbc-mysql.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "soci.h" -#include "soci-odbc.h" -#include "common-tests.h" -#include <iostream> -#include <string> -#include <cassert> -#include <ctime> -#include <cmath> - -using namespace SOCI; -using namespace SOCI::tests; - -std::string connectString; -BackEndFactory const &backEnd = odbc; - -// DDL Creation objects for common tests -struct TableCreator1 : public TableCreatorBase -{ - TableCreator1(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(id integer, val integer, c char, " - "str varchar(20), sh int2, ul numeric(20), d float8, " - "tm datetime, i1 integer, i2 integer, i3 integer, " - "name varchar(20))"; - } -}; - -struct TableCreator2 : public TableCreatorBase -{ - TableCreator2(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(num_float float8, num_int integer," - " name varchar(20), sometime datetime, chr char)"; - } -}; - -struct TableCreator3 : public TableCreatorBase -{ - TableCreator3(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(name varchar(100) not null, " - "phone varchar(15))"; - } -}; - -// -// Support for SOCI Common Tests -// - -class TestContext : public TestContextBase -{ -public: - TestContext(BackEndFactory const &backEnd, - std::string const &connectString) - : TestContextBase(backEnd, connectString) {} - - TableCreatorBase* tableCreator1(Session& s) const - { - return new TableCreator1(s); - } - - TableCreatorBase* tableCreator2(Session& s) const - { - return new TableCreator2(s); - } - - TableCreatorBase* tableCreator3(Session& s) const - { - return new TableCreator3(s); - } - - std::string toDateTime(std::string const &dateString) const - { - return "\'" + dateString + "\'"; - } - -}; - -int main(int argc, char** argv) -{ - -#ifdef _MSC_VER - // Redirect errors, unrecoverable problems, and assert() failures to STDERR, - // instead of debug message window. - // This hack is required to run asser()-driven tests by Buildbot. - // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside. - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); -#endif //_MSC_VER - - if (argc == 2) - { - connectString = argv[1]; - } - else - { - connectString = "FILEDSN=./test-mysql.dsn"; - } - try - { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); - tests.run(); - } - catch (SOCI::ODBCSOCIError const & e) - { - std::cout << "ODBC Error Code: " << e.odbcErrorCode() << std::endl - << "Native Error Code: " << e.nativeErrorCode() << std::endl - << "SOCI Message: " << e.what() << std::endl - << "ODBC Message: " << e.odbcErrorMessage() << std::endl; - } - catch (std::exception const & e) - { - std::cout << "STD::EXECEPTION " << e.what() << '\n'; - } -} diff --git a/src/backends/odbc/test/test-odbc-postgresql.cpp b/src/backends/odbc/test/test-odbc-postgresql.cpp deleted file mode 100644 index 347019a0..00000000 --- a/src/backends/odbc/test/test-odbc-postgresql.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "soci.h" -#include "soci-odbc.h" -#include "common-tests.h" -#include <iostream> -#include <string> -#include <cassert> -#include <ctime> -#include <cmath> - -using namespace SOCI; -using namespace SOCI::tests; - -std::string connectString; -BackEndFactory const &backEnd = odbc; - - -// DDL Creation objects for common tests -struct TableCreator1 : public TableCreatorBase -{ - TableCreator1(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(id integer, val integer, c char, " - "str varchar(20), sh int2, ul numeric(20), d float8, " - "tm timestamp, i1 integer, i2 integer, i3 integer, " - "name varchar(20))"; - } -}; - -struct TableCreator2 : public TableCreatorBase -{ - TableCreator2(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(num_float float8, num_int integer," - " name varchar(20), sometime timestamp, chr char)"; - } -}; - -struct TableCreator3 : public TableCreatorBase -{ - TableCreator3(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(name varchar(100) not null, " - "phone varchar(15))"; - } -}; - -// -// Support for SOCI Common Tests -// - -class TestContext : public TestContextBase -{ -public: - TestContext(BackEndFactory const &backEnd, - std::string const &connectString) - : TestContextBase(backEnd, connectString) {} - - TableCreatorBase* tableCreator1(Session& s) const - { - return new TableCreator1(s); - } - - TableCreatorBase* tableCreator2(Session& s) const - { - return new TableCreator2(s); - } - - TableCreatorBase* tableCreator3(Session& s) const - { - return new TableCreator3(s); - } - - std::string toDateTime(std::string const &dateString) const - { - return "timestamptz(\'" + dateString + "\')"; - } - -}; - -int main(int argc, char** argv) -{ - -#ifdef _MSC_VER - // Redirect errors, unrecoverable problems, and assert() failures to STDERR, - // instead of debug message window. - // This hack is required to run asser()-driven tests by Buildbot. - // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside. - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); -#endif //_MSC_VER - - if (argc == 2) - { - connectString = argv[1]; - } - else - { - connectString = "FILEDSN=./test-postgresql.dsn"; - } - try - { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); - tests.run(); - } - catch (SOCI::ODBCSOCIError const & e) - { - std::cout << "ODBC Error Code: " << e.odbcErrorCode() << std::endl - << "Native Error Code: " << e.nativeErrorCode() << std::endl - << "SOCI Message: " << e.what() << std::endl - << "ODBC Message: " << e.odbcErrorMessage() << std::endl; - } - catch (std::exception const & e) - { - std::cout << "STD::EXECEPTION " << e.what() << '\n'; - } -} diff --git a/src/backends/odbc/test/test-postgresql.dsn b/src/backends/odbc/test/test-postgresql.dsn deleted file mode 100644 index dba5ef63..00000000 --- a/src/backends/odbc/test/test-postgresql.dsn +++ /dev/null @@ -1,38 +0,0 @@ -[ODBC] -DRIVER=PostgreSQL ANSI -UID=davidc -PASSWORD=socitest -LowerCaseIdentifier=0 -UseServerSidePrepare=0 -ByteaAsLongVarBinary=0 -BI=0 -TrueIsMinus1=0 -DisallowPremature=0 -UpdatableCursors=0 -LFConversion=1 -ExtraSysTablePrefixes=dd_ -CancelAsFreeStmt=0 -Parse=0 -BoolsAsChar=1 -UnknownsAsLongVarchar=0 -TextAsLongVarchar=1 -UseDeclareFetch=0 -Ksqo=1 -Optimizer=1 -CommLog=0 -Debug=0 -MaxLongVarcharSize=8190 -MaxVarcharSize=254 -UnknownSizes=0 -Socket=8192 -Fetch=100 -ConnSettings= -ShowSystemTables=0 -RowVersioning=0 -ShowOidColumn=0 -FakeOidIndex=0 -ReadOnly=0 -SSLMODE=prefer -PORT=5432 -SERVER=localhost -DATABASE=socitest diff --git a/src/backends/odbc/utility.h b/src/backends/odbc/utility.h deleted file mode 100644 index 48defcbd..00000000 --- a/src/backends/odbc/utility.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef UTILITY_H_INCLUDED -#define UTILITY_H_INCLUDED - -#include "soci-backend.h" -#include <sstream> - -namespace SOCI -{ - -inline void throw_odbc_error(SQLSMALLINT htype, SQLHANDLE hndl, char const * msg) -{ - SQLCHAR message[SQL_MAX_MESSAGE_LENGTH + 1]; - SQLCHAR sqlstate[SQL_SQLSTATE_SIZE + 1]; - SQLINTEGER sqlcode; - SQLSMALLINT length, i; - - std::stringstream ss; - - i = 1; - - /* get multiple field settings of diagnostic record */ - while (SQLGetDiagRec(htype, - hndl, - i, - sqlstate, - &sqlcode, - message, - SQL_MAX_MESSAGE_LENGTH + 1, - &length) == SQL_SUCCESS) - { - ss << std::endl << "SOCI ODBC Error: " << msg << std::endl - << "SQLSTATE = " << sqlstate << std::endl - << "Native Error Code = " << sqlcode << std::endl - << message << std::endl; - ++i; - } - - throw SOCIError(ss.str()); -} - -inline bool is_odbc_error(SQLRETURN rc) -{ - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) - return true; - else - return false; -} - -} - -#endif - diff --git a/src/backends/odbc/vector-into-type.cpp b/src/backends/odbc/vector-into-type.cpp deleted file mode 100644 index b0ef3869..00000000 --- a/src/backends/odbc/vector-into-type.cpp +++ /dev/null @@ -1,390 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> -#include <cctype> -#include <cstdio> -#include <cstring> -#include <ctime> -#include <sstream> - -using namespace SOCI; -using namespace SOCI::details; - -void ODBCVectorIntoTypeBackEnd::prepareIndicators(std::size_t size) -{ - if (size == 0) - { - throw SOCIError("Vectors of size 0 are not allowed."); - } - - indHolderVec_.resize(size); - indHolders_ = &indHolderVec_[0]; -} - -void ODBCVectorIntoTypeBackEnd::defineByPos( - int &position, void *data, eExchangeType type) -{ - data_ = data; // for future reference - type_ = type; // for future reference - - SQLINTEGER size = 0; // also dummy - - switch (type) - { - // simple cases - case eXShort: - { - odbcType_ = SQL_C_SSHORT; - size = sizeof(short); - std::vector<short> *vp = static_cast<std::vector<short> *>(data); - std::vector<short> &v(*vp); - prepareIndicators(v.size()); - data = &v[0]; - } - break; - case eXInteger: - { - odbcType_ = SQL_C_SLONG; - size = sizeof(long); - std::vector<long> *vp = static_cast<std::vector<long> *>(data); - std::vector<long> &v(*vp); - prepareIndicators(v.size()); - data = &v[0]; - } - break; - case eXUnsignedLong: - { - odbcType_ = SQL_C_ULONG; - size = sizeof(unsigned long); - std::vector<unsigned long> *vp - = static_cast<std::vector<unsigned long> *>(data); - std::vector<unsigned long> &v(*vp); - prepareIndicators(v.size()); - data = &v[0]; - } - break; - case eXDouble: - { - odbcType_ = SQL_C_DOUBLE; - size = sizeof(double); - std::vector<double> *vp = static_cast<std::vector<double> *>(data); - std::vector<double> &v(*vp); - prepareIndicators(v.size()); - data = &v[0]; - } - break; - - // cases that require adjustments and buffer management - - case eXChar: - { - odbcType_ = SQL_C_CHAR; - - std::vector<char> *v - = static_cast<std::vector<char> *>(data); - - prepareIndicators(v->size()); - - size = sizeof(char) * 2; - std::size_t bufSize = size * v->size(); - - colSize_ = size; - - buf_ = new char[bufSize]; - data = buf_; - } - break; - case eXStdString: - { - odbcType_ = SQL_C_CHAR; - std::vector<std::string> *v - = static_cast<std::vector<std::string> *>(data); - colSize_ = statement_.columnSize(position) + 1; - std::size_t bufSize = colSize_ * v->size(); - buf_ = new char[bufSize]; - - prepareIndicators(v->size()); - - size = static_cast<SQLINTEGER>(colSize_); - data = buf_; - } - break; - case eXStdTm: - { - odbcType_ = SQL_C_TYPE_TIMESTAMP; - std::vector<std::tm> *v - = static_cast<std::vector<std::tm> *>(data); - - prepareIndicators(v->size()); - - size = sizeof(TIMESTAMP_STRUCT); - colSize_ = size; - - std::size_t bufSize = size * v->size(); - - buf_ = new char[bufSize]; - data = buf_; - } - break; - - case eXCString: break; // not supported - // (there is no specialization - // of IntoType<vector<char*> >) - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported - } - - SQLRETURN rc = SQLBindCol(statement_.hstmt_, position++, odbcType_, data, size, indHolders_); - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, statement_.hstmt_, - "vector into type define by pos"); - } -} - -void ODBCVectorIntoTypeBackEnd::preFetch() -{ - // nothing to do for the supported types -} - -void ODBCVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) -{ - if (gotData) - { - // first, deal with data - - // only std::string, std::tm and Statement need special handling - if (type_ == eXChar) - { - std::vector<char> *vp - = static_cast<std::vector<char> *>(data_); - - std::vector<char> &v(*vp); - char *pos = buf_; - std::size_t const vsize = v.size(); - for (std::size_t i = 0; i != vsize; ++i) - { - v[i] = *pos; - pos += colSize_; - } - } - if (type_ == eXStdString) - { - std::vector<std::string> *vp - = static_cast<std::vector<std::string> *>(data_); - - std::vector<std::string> &v(*vp); - - char *pos = buf_; - std::size_t const vsize = v.size(); - for (std::size_t i = 0; i != vsize; ++i) - { - v[i].assign(pos, strlen(pos)); - pos += colSize_; - } - } - else if (type_ == eXStdTm) - { - std::vector<std::tm> *vp - = static_cast<std::vector<std::tm> *>(data_); - - std::vector<std::tm> &v(*vp); - char *pos = buf_; - std::size_t const vsize = v.size(); - for (std::size_t i = 0; i != vsize; ++i) - { - std::tm t; - - TIMESTAMP_STRUCT * ts = reinterpret_cast<TIMESTAMP_STRUCT*>(pos); - t.tm_isdst = -1; - t.tm_year = ts->year - 1900; - t.tm_mon = ts->month - 1; - t.tm_mday = ts->day; - t.tm_hour = ts->hour; - t.tm_min = ts->minute; - t.tm_sec = ts->second; - - // normalize and compute the remaining fields - std::mktime(&t); - v[i] = t; - pos += colSize_; - } - } - - // then - deal with indicators - if (ind != NULL) - { - std::size_t const indSize = indHolderVec_.size(); - for (std::size_t i = 0; i != indSize; ++i) - { - if (indHolderVec_[i] > 0) - { - ind[i] = eOK; - } - else if (indHolderVec_[i] == SQL_NULL_DATA) - { - ind[i] = eNull; - } - else - { - ind[i] = eTruncated; - } - } - } - else - { - std::size_t const indSize = indHolderVec_.size(); - for (std::size_t i = 0; i != indSize; ++i) - { - if (indHolderVec_[i] == SQL_NULL_DATA) - { - // fetched null and no indicator - programming error! - throw SOCIError( - "Null value fetched and no indicator defined."); - } - } - } - } - else // gotData == false - { - // nothing to do here, vectors are truncated anyway - } -} - -void ODBCVectorIntoTypeBackEnd::resize(std::size_t sz) -{ - switch (type_) - { - // simple cases - case eXChar: - { - std::vector<char> *v = static_cast<std::vector<char> *>(data_); - v->resize(sz); - } - break; - case eXShort: - { - std::vector<short> *v = static_cast<std::vector<short> *>(data_); - v->resize(sz); - } - break; - case eXInteger: - { - std::vector<long> *v = static_cast<std::vector<long> *>(data_); - v->resize(sz); - } - break; - case eXUnsignedLong: - { - std::vector<unsigned long> *v - = static_cast<std::vector<unsigned long> *>(data_); - v->resize(sz); - } - break; - case eXDouble: - { - std::vector<double> *v - = static_cast<std::vector<double> *>(data_); - v->resize(sz); - } - break; - case eXStdString: - { - std::vector<std::string> *v - = static_cast<std::vector<std::string> *>(data_); - v->resize(sz); - } - break; - case eXStdTm: - { - std::vector<std::tm> *v - = static_cast<std::vector<std::tm> *>(data_); - v->resize(sz); - } - break; - - case eXCString: break; // not supported - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported - } -} - -std::size_t ODBCVectorIntoTypeBackEnd::size() -{ - std::size_t sz = 0; // dummy initialization to please the compiler - switch (type_) - { - // simple cases - case eXChar: - { - std::vector<char> *v = static_cast<std::vector<char> *>(data_); - sz = v->size(); - } - break; - case eXShort: - { - std::vector<short> *v = static_cast<std::vector<short> *>(data_); - sz = v->size(); - } - break; - case eXInteger: - { - std::vector<long> *v = static_cast<std::vector<long> *>(data_); - sz = v->size(); - } - break; - case eXUnsignedLong: - { - std::vector<unsigned long> *v - = static_cast<std::vector<unsigned long> *>(data_); - sz = v->size(); - } - break; - case eXDouble: - { - std::vector<double> *v - = static_cast<std::vector<double> *>(data_); - sz = v->size(); - } - break; - case eXStdString: - { - std::vector<std::string> *v - = static_cast<std::vector<std::string> *>(data_); - sz = v->size(); - } - break; - case eXStdTm: - { - std::vector<std::tm> *v - = static_cast<std::vector<std::tm> *>(data_); - sz = v->size(); - } - break; - - case eXCString: break; // not supported - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported - } - - return sz; -} - -void ODBCVectorIntoTypeBackEnd::cleanUp() -{ - if (buf_ != NULL) - { - delete [] buf_; - buf_ = NULL; - } -} diff --git a/src/backends/odbc/vector-use-type.cpp b/src/backends/odbc/vector-use-type.cpp deleted file mode 100644 index 7dfe2188..00000000 --- a/src/backends/odbc/vector-use-type.cpp +++ /dev/null @@ -1,380 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_ODBC_SOURCE -#include "soci-odbc.h" -#include <soci.h> -#include <cctype> -#include <cstdio> -#include <cstring> -#include <ctime> -#include <sstream> - -#ifdef _MSC_VER -// disables the warning about converting int to void*. This is a 64 bit compatibility -// warning, but odbc requires the value to be converted on this line -// SQLSetStmtAttr(statement_.hstmt_, SQL_ATTR_PARAMSET_SIZE, (SQLPOINTER)arraySize, 0); -#pragma warning(disable:4312) -#endif - - -using namespace SOCI; -using namespace SOCI::details; - -void ODBCVectorUseTypeBackEnd::prepareIndicators(std::size_t size) -{ - if (size == 0) - { - throw SOCIError("Vectors of size 0 are not allowed."); - } - - indHolderVec_.resize(size); - indHolders_ = &indHolderVec_[0]; -} - -void ODBCVectorUseTypeBackEnd::prepareForBind(void *&data, SQLUINTEGER &size, SQLSMALLINT &sqlType, SQLSMALLINT &cType) -{ - switch (type_) - { // simple cases - case eXShort: - { - sqlType = SQL_SMALLINT; - cType = SQL_C_SSHORT; - size = sizeof(short); - std::vector<short> *vp = static_cast<std::vector<short> *>(data); - std::vector<short> &v(*vp); - prepareIndicators(v.size()); - data = &v[0]; - } - break; - case eXInteger: - { - sqlType = SQL_INTEGER; - cType = SQL_C_SLONG; - size = sizeof(int); - std::vector<int> *vp = static_cast<std::vector<int> *>(data); - std::vector<int> &v(*vp); - prepareIndicators(v.size()); - data = &v[0]; - } - break; - case eXUnsignedLong: - { - sqlType = SQL_BIGINT; - cType = SQL_C_ULONG; - size = sizeof(unsigned long); - std::vector<unsigned long> *vp - = static_cast<std::vector<unsigned long> *>(data); - std::vector<unsigned long> &v(*vp); - prepareIndicators(v.size()); - data = &v[0]; - } - break; - case eXDouble: - { - sqlType = SQL_DOUBLE; - cType = SQL_C_DOUBLE; - size = sizeof(double); - std::vector<double> *vp = static_cast<std::vector<double> *>(data); - std::vector<double> &v(*vp); - prepareIndicators(v.size()); - data = &v[0]; - } - break; - - // cases that require adjustments and buffer management - case eXChar: - { - std::vector<char> *vp - = static_cast<std::vector<char> *>(data); - std::size_t const vsize = vp->size(); - - prepareIndicators(vsize); - - size = sizeof(char) * 2; - buf_ = new char[size * vsize]; - - char *pos = buf_; - - for (std::size_t i = 0; i != vsize; ++i) - { - *pos++ = (*vp)[i]; - *pos++ = 0; - } - - sqlType = SQL_CHAR; - cType = SQL_C_CHAR; - data = buf_; - } - break; - case eXStdString: - { - sqlType = SQL_CHAR; - cType = SQL_C_CHAR; - - std::vector<std::string> *vp - = static_cast<std::vector<std::string> *>(data); - std::vector<std::string> &v(*vp); - - std::size_t maxSize = 0; - std::size_t const vecSize = v.size(); - prepareIndicators(vecSize); - for (std::size_t i = 0; i != vecSize; ++i) - { - std::size_t sz = v[i].length() + 1; // add one for null - indHolderVec_[i] = static_cast<long>(sz); - maxSize = sz > maxSize ? sz : maxSize; - } - - buf_ = new char[maxSize * vecSize]; - memset(buf_, 0, maxSize * vecSize); - - char *pos = buf_; - for (std::size_t i = 0; i != vecSize; ++i) - { - strncpy(pos, v[i].c_str(), v[i].length()); - pos += maxSize; - } - - data = buf_; - size = static_cast<SQLINTEGER>(maxSize); - } - break; - case eXStdTm: - { - std::vector<std::tm> *vp - = static_cast<std::vector<std::tm> *>(data); - - prepareIndicators(vp->size()); - - buf_ = new char[sizeof(TIMESTAMP_STRUCT) * vp->size()]; - - sqlType = SQL_TYPE_TIMESTAMP; - cType = SQL_C_TYPE_TIMESTAMP; - data = buf_; - size = 19; // This number is not the size in bytes, but the number - // of characters in the date if it was written out - // yyyy-mm-dd hh:mm:ss - } - break; - - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported - case eXCString: break; // not supported - } - - colSize_ = size; -} - -void ODBCVectorUseTypeBackEnd::bindHelper(int &position, void *data, eExchangeType type) -{ - data_ = data; // for future reference - type_ = type; // for future reference - - SQLSMALLINT sqlType; - SQLSMALLINT cType; - SQLUINTEGER size; - - prepareForBind(data, size, sqlType, cType); - - SQLINTEGER arraySize = (SQLINTEGER)indHolderVec_.size(); - SQLSetStmtAttr(statement_.hstmt_, SQL_ATTR_PARAMSET_SIZE, (SQLPOINTER)arraySize, 0); - - SQLRETURN rc = SQLBindParameter(statement_.hstmt_, position++, SQL_PARAM_INPUT, - cType, sqlType, size, 0, (SQLPOINTER)data, - size, indHolders_); - - if (is_odbc_error(rc)) - { - throw ODBCSOCIError(SQL_HANDLE_STMT, statement_.hstmt_, - "Error while binding value to column"); - } -} - -void ODBCVectorUseTypeBackEnd::bindByPos(int &position, - void *data, eExchangeType type) -{ - if (statement_.boundByName_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - bindHelper(position, data, type); - - statement_.boundByPos_ = true; -} - -void ODBCVectorUseTypeBackEnd::bindByName( - std::string const &name, void *data, eExchangeType type) -{ - if (statement_.boundByPos_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - int position = -1; - int count = 1; - - for (std::vector<std::string>::iterator it = statement_.names_.begin(); - it != statement_.names_.end(); ++it) - { - if (*it == name) - { - position = count; - break; - } - count++; - } - - if (position != -1) - bindHelper(position, data, type); - else - { - std::ostringstream ss; - ss << "Unable to find name '" << name << "' to bind to"; - throw SOCIError(ss.str().c_str()); - } - - statement_.boundByName_ = true; -} - -void ODBCVectorUseTypeBackEnd::preUse(eIndicator const *ind) -{ - // first deal with data - if (type_ == eXStdTm) - { - std::vector<std::tm> *vp - = static_cast<std::vector<std::tm> *>(data_); - - std::vector<std::tm> &v(*vp); - - char *pos = buf_; - std::size_t const vsize = v.size(); - for (std::size_t i = 0; i != vsize; ++i) - { - std::tm t = v[i]; - TIMESTAMP_STRUCT * ts = reinterpret_cast<TIMESTAMP_STRUCT*>(pos); - - ts->year = t.tm_year + 1900; - ts->month = t.tm_mon + 1; - ts->day = t.tm_mday; - ts->hour = t.tm_hour; - ts->minute = t.tm_min; - ts->second = t.tm_sec; - ts->fraction = 0; - pos += sizeof(TIMESTAMP_STRUCT); - } - } - - // then handle indicators - if (ind != NULL) - { - std::size_t const vsize = size(); - for (std::size_t i = 0; i != vsize; ++i, ++ind) - { - if (*ind == eNull) - { - indHolderVec_[i] = SQL_NULL_DATA; // null - } - else - { - // for strings we have already set the values - if (type_ != eXStdString) - { - indHolderVec_[i] = SQL_NTS; // value is OK - } - } - } - } - else - { - // no indicators - treat all fields as OK - std::size_t const vsize = size(); - for (std::size_t i = 0; i != vsize; ++i, ++ind) - { - // for strings we have already set the values - if (type_ != eXStdString) - { - indHolderVec_[i] = SQL_NTS; // value is OK - } - } - } -} - -std::size_t ODBCVectorUseTypeBackEnd::size() -{ - std::size_t sz = 0; // dummy initialization to please the compiler - switch (type_) - { - // simple cases - case eXChar: - { - std::vector<char> *vp = static_cast<std::vector<char> *>(data_); - sz = vp->size(); - } - break; - case eXShort: - { - std::vector<short> *vp = static_cast<std::vector<short> *>(data_); - sz = vp->size(); - } - break; - case eXInteger: - { - std::vector<int> *vp = static_cast<std::vector<int> *>(data_); - sz = vp->size(); - } - break; - case eXUnsignedLong: - { - std::vector<unsigned long> *vp - = static_cast<std::vector<unsigned long> *>(data_); - sz = vp->size(); - } - break; - case eXDouble: - { - std::vector<double> *vp - = static_cast<std::vector<double> *>(data_); - sz = vp->size(); - } - break; - case eXStdString: - { - std::vector<std::string> *vp - = static_cast<std::vector<std::string> *>(data_); - sz = vp->size(); - } - break; - case eXStdTm: - { - std::vector<std::tm> *vp - = static_cast<std::vector<std::tm> *>(data_); - sz = vp->size(); - } - break; - - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported - case eXCString: break; // not supported - } - - return sz; -} - -void ODBCVectorUseTypeBackEnd::cleanUp() -{ - if (buf_ != NULL) - { - delete [] buf_; - buf_ = NULL; - } -} diff --git a/src/backends/oracle/Makefile.am b/src/backends/oracle/Makefile.am deleted file mode 100644 index 1c1f1415..00000000 --- a/src/backends/oracle/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @ORACLE_OCI_CFLAGS@ -AM_LDFLAGS = @ORACLE_OCI_LDFLAGS@ - -lib_LTLIBRARIES = \ - lib@SOCI_ORACLE_LIBRARY_NAME@.la - -lib@SOCI_ORACLE_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_ORACLE_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - error.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_oracledir = $(includedir)/soci/oracle - -soci_oracle_HEADERS = \ - error.h \ - soci-oracle.h - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/oracle/Makefile.basic b/src/backends/oracle/Makefile.basic index 92656baf..85e4df2e 100644 --- a/src/backends/oracle/Makefile.basic +++ b/src/backends/oracle/Makefile.basic @@ -1,7 +1,7 @@ # The following variable is specific to this backend and its correct # values might depend on your environment - feel free to set it accordingly. -ORACLEINCLUDEDIR = -I/u01/oracle/product/10.1.0/rdbms/public +ORACLEINCLUDEDIR = -I/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public # The rest of the Makefile is indepentent of the target environment. @@ -18,7 +18,7 @@ OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ standard-into-type-s.o standard-use-type-s.o statement-s.o \ vector-into-type-s.o vector-use-type-s.o error-s.o -libsoci-oracle.a : ${OBJECTS} +libsoci_oracle.a : ${OBJECTS} ar rv $@ $? rm *.o @@ -57,7 +57,7 @@ vector-use-type.o : vector-use-type.cpp shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci-oracle.so ${OBJECTSSO} + ${COMPILER} -shared -o libsoci_oracle.so ${OBJECTSSO} rm *.o blob-s.o : blob.cpp @@ -92,4 +92,4 @@ vector-use-type-s.o : vector-use-type.cpp clean : - rm -f *.o libsoci-oracle.a libsoci-oracle.so + rm -f *.o libsoci_oracle.a libsoci_oracle.so diff --git a/src/backends/oracle/Makefile.in b/src/backends/oracle/Makefile.in deleted file mode 100644 index 1dd0c832..00000000 --- a/src/backends/oracle/Makefile.in +++ /dev/null @@ -1,561 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends/oracle -DIST_COMMON = $(soci_oracle_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soci_oracledir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -lib@SOCI_ORACLE_LIBRARY_NAME@_la_LIBADD = -am_lib@SOCI_ORACLE_LIBRARY_NAME@_la_OBJECTS = blob.lo error.lo \ - factory.lo row-id.lo session.lo standard-into-type.lo \ - standard-use-type.lo statement.lo vector-into-type.lo \ - vector-use-type.lo -lib@SOCI_ORACLE_LIBRARY_NAME@_la_OBJECTS = \ - $(am_lib@SOCI_ORACLE_LIBRARY_NAME@_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib@SOCI_ORACLE_LIBRARY_NAME@_la_SOURCES) -DIST_SOURCES = $(lib@SOCI_ORACLE_LIBRARY_NAME@_la_SOURCES) -soci_oracleHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(soci_oracle_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @ORACLE_OCI_CFLAGS@ -AM_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -lib_LTLIBRARIES = \ - lib@SOCI_ORACLE_LIBRARY_NAME@.la - -lib@SOCI_ORACLE_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_ORACLE_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - error.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_oracledir = $(includedir)/soci/oracle -soci_oracle_HEADERS = \ - error.h \ - soci-oracle.h - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/oracle/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/oracle/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -lib@SOCI_ORACLE_LIBRARY_NAME@.la: $(lib@SOCI_ORACLE_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_ORACLE_LIBRARY_NAME@_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(lib@SOCI_ORACLE_LIBRARY_NAME@_la_LDFLAGS) $(lib@SOCI_ORACLE_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_ORACLE_LIBRARY_NAME@_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blob.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/row-id.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-use-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-use-type.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-soci_oracleHEADERS: $(soci_oracle_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(soci_oracledir)" || $(mkdir_p) "$(DESTDIR)$(soci_oracledir)" - @list='$(soci_oracle_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(soci_oracleHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(soci_oracledir)/$$f'"; \ - $(soci_oracleHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(soci_oracledir)/$$f"; \ - done - -uninstall-soci_oracleHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(soci_oracle_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(soci_oracledir)/$$f'"; \ - rm -f "$(DESTDIR)$(soci_oracledir)/$$f"; \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soci_oracledir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-soci_oracleHEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-soci_oracleHEADERS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-soci_oracleHEADERS \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-libLTLIBRARIES uninstall-soci_oracleHEADERS - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/oracle/blob.cpp b/src/backends/oracle/blob.cpp index 50442422..2636e665 100644 --- a/src/backends/oracle/blob.cpp +++ b/src/backends/oracle/blob.cpp @@ -1,13 +1,13 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci.h" #include "soci-oracle.h" #include "error.h" +#include "statement.h" #include <cstring> #include <sstream> #include <cstdio> @@ -18,27 +18,27 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Oracle; +using namespace soci; +using namespace soci::details; +using namespace soci::details::oracle; -OracleBLOBBackEnd::OracleBLOBBackEnd(OracleSessionBackEnd &session) +oracle_blob_backend::oracle_blob_backend(oracle_session_backend &session) : session_(session) { sword res = OCIDescriptorAlloc(session.envhp_, reinterpret_cast<dvoid**>(&lobp_), OCI_DTYPE_LOB, 0, 0); if (res != OCI_SUCCESS) { - throw SOCIError("Cannot allocate the LOB locator"); + throw soci_error("Cannot allocate the LOB locator"); } } -OracleBLOBBackEnd::~OracleBLOBBackEnd() +oracle_blob_backend::~oracle_blob_backend() { OCIDescriptorFree(lobp_, OCI_DTYPE_LOB); } -std::size_t OracleBLOBBackEnd::getLen() +std::size_t oracle_blob_backend::get_len() { ub4 len; @@ -47,13 +47,13 @@ std::size_t OracleBLOBBackEnd::getLen() if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } return static_cast<std::size_t>(len); } -std::size_t OracleBLOBBackEnd::read( +std::size_t oracle_blob_backend::read( std::size_t offset, char *buf, std::size_t toRead) { ub4 amt = static_cast<ub4>(toRead); @@ -63,13 +63,13 @@ std::size_t OracleBLOBBackEnd::read( amt, 0, 0, 0, 0); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } return static_cast<std::size_t>(amt); } -std::size_t OracleBLOBBackEnd::write( +std::size_t oracle_blob_backend::write( std::size_t offset, char const *buf, std::size_t toWrite) { ub4 amt = static_cast<ub4>(toWrite); @@ -80,13 +80,13 @@ std::size_t OracleBLOBBackEnd::write( amt, OCI_ONE_PIECE, 0, 0, 0, 0); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } return static_cast<std::size_t>(amt); } -std::size_t OracleBLOBBackEnd::append(char const *buf, std::size_t toWrite) +std::size_t oracle_blob_backend::append(char const *buf, std::size_t toWrite) { ub4 amt = static_cast<ub4>(toWrite); @@ -95,19 +95,18 @@ std::size_t OracleBLOBBackEnd::append(char const *buf, std::size_t toWrite) amt, OCI_ONE_PIECE, 0, 0, 0, 0); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } return static_cast<std::size_t>(amt); } -void OracleBLOBBackEnd::trim(std::size_t newLen) +void oracle_blob_backend::trim(std::size_t newLen) { sword res = OCILobTrim(session_.svchp_, session_.errhp_, lobp_, static_cast<ub4>(newLen)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } } - diff --git a/src/backends/oracle/error.cpp b/src/backends/oracle/error.cpp index 30896a0c..12b72bcd 100644 --- a/src/backends/oracle/error.cpp +++ b/src/backends/oracle/error.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,7 +8,6 @@ #define SOCI_ORACLE_SOURCE #include "soci-oracle.h" #include "error.h" -#include <soci.h> #include <limits> #include <sstream> @@ -16,18 +15,16 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Oracle; +using namespace soci; +using namespace soci::details; +using namespace soci::details::oracle; - -OracleSOCIError::OracleSOCIError(std::string const & msg, int errNum) - : SOCIError(msg), errNum_(errNum) +oracle_soci_error::oracle_soci_error(std::string const & msg, int errNum) + : soci_error(msg), err_num_(errNum) { } - -void SOCI::details::Oracle::getErrorDetails(sword res, OCIError *errhp, +void soci::details::oracle::get_error_details(sword res, OCIError *errhp, std::string &msg, int &errNum) { text errbuf[512]; @@ -37,7 +34,7 @@ void SOCI::details::Oracle::getErrorDetails(sword res, OCIError *errhp, switch (res) { case OCI_NO_DATA: - msg = "SOCI error: No data"; + msg = "soci error: No data"; break; case OCI_ERROR: OCIErrorGet(errhp, 1, 0, &errcode, @@ -46,21 +43,18 @@ void SOCI::details::Oracle::getErrorDetails(sword res, OCIError *errhp, errNum = static_cast<int>(errcode); break; case OCI_INVALID_HANDLE: - msg = "SOCI error: Invalid handle"; + msg = "soci error: Invalid handle"; break; default: - msg = "SOCI error: Unknown error code"; + msg = "soci error: Unknown error code"; } } -void SOCI::details::Oracle::throwOracleSOCIError(sword res, OCIError *errhp) +void soci::details::oracle::throw_oracle_soci_error(sword res, OCIError *errhp) { std::string msg; int errNum; - getErrorDetails(res, errhp, msg, errNum); - throw OracleSOCIError(msg, errNum); + get_error_details(res, errhp, msg, errNum); + throw oracle_soci_error(msg, errNum); } - - - diff --git a/src/backends/oracle/error.h b/src/backends/oracle/error.h index c9646d1a..2dbe9214 100644 --- a/src/backends/oracle/error.h +++ b/src/backends/oracle/error.h @@ -1,31 +1,33 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef ORACLE_COMMON_H_INCLUDED -#define ORACLE_COMMON_H_INCLUDED +#ifndef SOCI_ORACLE_ERROR_H_INCLUDED +#define SOCI_ORACLE_ERROR_H_INCLUDED #include "soci-oracle.h" -namespace SOCI { +namespace soci +{ -namespace details { +namespace details +{ -namespace Oracle { +namespace oracle +{ -void throwOracleSOCIError(sword res, OCIError *errhp); +void throw_oracle_soci_error(sword res, OCIError *errhp); -void getErrorDetails(sword res, OCIError *errhp, +void get_error_details(sword res, OCIError *errhp, std::string &msg, int &errNum); -} // namespace Oracle +} // namespace oracle } // namespace details -} // namespace SOCI - -#endif // ORACLE_COMMON_H_INCLUDED +} // namespace soci +#endif diff --git a/src/backends/oracle/factory.cpp b/src/backends/oracle/factory.cpp index 7e0b2f75..a2c1dc9e 100644 --- a/src/backends/oracle/factory.cpp +++ b/src/backends/oracle/factory.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,7 +7,6 @@ #define SOCI_ORACLE_SOURCE #include "soci-oracle.h" -#include <soci.h> #include <cctype> #include <cstdio> #include <cstring> @@ -18,12 +17,13 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; // retrieves service name, user name and password from the // uniform connect string -void chopConnectString(std::string const &connectString, - std::string &serviceName, std::string &userName, std::string &password) +void chop_connect_string(std::string const & connectString, + std::string & serviceName, std::string & userName, + std::string & password, int & mode) { std::string tmp; for (std::string::const_iterator i = connectString.begin(), @@ -42,6 +42,7 @@ void chopConnectString(std::string const &connectString, serviceName.clear(); userName.clear(); password.clear(); + mode = OCI_DEFAULT; std::istringstream iss(tmp); std::string key, value; @@ -59,16 +60,49 @@ void chopConnectString(std::string const &connectString, { password = value; } + else if (key == "mode") + { + if (value == "sysdba") + { + mode = OCI_SYSDBA; + } + else if (value == "sysoper") + { + mode = OCI_SYSOPER; + } + else if (value == "default") + { + mode = OCI_DEFAULT; + } + else + { + throw soci_error("Invalid connection mode."); + } + } } } // concrete factory for Empty concrete strategies -OracleSessionBackEnd * OracleBackEndFactory::makeSession( +oracle_session_backend * oracle_backend_factory::make_session( std::string const &connectString) const { std::string serviceName, userName, password; - chopConnectString(connectString, serviceName, userName, password); - return new OracleSessionBackEnd(serviceName, userName, password); + int mode; + + chop_connect_string(connectString, serviceName, userName, password, mode); + + return new oracle_session_backend(serviceName, userName, password, mode); +} + +oracle_backend_factory const soci::oracle; + +extern "C" +{ + +// for dynamic backend loading +SOCI_ORACLE_DECL backend_factory const * factory_oracle() +{ + return &soci::oracle; } -OracleBackEndFactory const SOCI::oracle; +} // extern "C" diff --git a/src/backends/oracle/row-id.cpp b/src/backends/oracle/row-id.cpp index 4d60defc..c01e0141 100644 --- a/src/backends/oracle/row-id.cpp +++ b/src/backends/oracle/row-id.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,7 +7,6 @@ #define SOCI_ORACLE_SOURCE #include "soci-oracle.h" -#include <soci.h> #include <cctype> #include <cstdio> #include <cstring> @@ -22,21 +21,20 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; -OracleRowIDBackEnd::OracleRowIDBackEnd(OracleSessionBackEnd &session) +oracle_rowid_backend::oracle_rowid_backend(oracle_session_backend &session) { sword res = OCIDescriptorAlloc(session.envhp_, reinterpret_cast<dvoid**>(&rowidp_), OCI_DTYPE_ROWID, 0, 0); if (res != OCI_SUCCESS) { - throw SOCIError("Cannot allocate the ROWID descriptor"); + throw soci_error("Cannot allocate the ROWID descriptor"); } } -OracleRowIDBackEnd::~OracleRowIDBackEnd() +oracle_rowid_backend::~oracle_rowid_backend() { OCIDescriptorFree(rowidp_, OCI_DTYPE_ROWID); } - diff --git a/src/backends/oracle/session.cpp b/src/backends/oracle/session.cpp index e40ac66d..f120e56c 100644 --- a/src/backends/oracle/session.cpp +++ b/src/backends/oracle/session.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,7 +8,6 @@ #define SOCI_ORACLE_SOURCE #include "soci-oracle.h" #include "error.h" -#include <soci.h> #include <cctype> #include <cstdio> #include <cstring> @@ -19,12 +18,12 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Oracle; +using namespace soci; +using namespace soci::details; +using namespace soci::details::oracle; -OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, - std::string const & userName, std::string const & password) +oracle_session_backend::oracle_session_backend(std::string const & serviceName, + std::string const & userName, std::string const & password, int mode) : envhp_(NULL), srvhp_(NULL), errhp_(NULL), svchp_(NULL), usrhp_(NULL) { sword res; @@ -33,7 +32,7 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, res = OCIEnvCreate(&envhp_, OCI_DEFAULT, 0, 0, 0, 0, 0, 0); if (res != OCI_SUCCESS) { - throw SOCIError("Cannot create environment"); + throw soci_error("Cannot create environment"); } // create the server handle @@ -41,8 +40,8 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, OCI_HTYPE_SERVER, 0, 0); if (res != OCI_SUCCESS) { - cleanUp(); - throw SOCIError("Cannot create server handle"); + clean_up(); + throw soci_error("Cannot create server handle"); } // create the error handle @@ -50,8 +49,8 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, OCI_HTYPE_ERROR, 0, 0); if (res != OCI_SUCCESS) { - cleanUp(); - throw SOCIError("Cannot create error handle"); + clean_up(); + throw soci_error("Cannot create error handle"); } // create the server context @@ -63,9 +62,9 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, { std::string msg; int errNum; - getErrorDetails(res, errhp_, msg, errNum); - cleanUp(); - throw OracleSOCIError(msg, errNum); + get_error_details(res, errhp_, msg, errNum); + clean_up(); + throw oracle_soci_error(msg, errNum); } // create service context handle @@ -73,8 +72,8 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, OCI_HTYPE_SVCCTX, 0, 0); if (res != OCI_SUCCESS) { - cleanUp(); - throw SOCIError("Cannot create service context"); + clean_up(); + throw soci_error("Cannot create service context"); } // set the server attribute in the context handle @@ -84,9 +83,9 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, { std::string msg; int errNum; - getErrorDetails(res, errhp_, msg, errNum); - cleanUp(); - throw OracleSOCIError(msg, errNum); + get_error_details(res, errhp_, msg, errNum); + clean_up(); + throw oracle_soci_error(msg, errNum); } // allocate user session handle @@ -94,8 +93,8 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, OCI_HTYPE_SESSION, 0, 0); if (res != OCI_SUCCESS) { - cleanUp(); - throw SOCIError("Cannot allocate user session handle"); + clean_up(); + throw soci_error("Cannot allocate user session handle"); } // set username attribute in the user session handle @@ -105,8 +104,8 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, userNameLen, OCI_ATTR_USERNAME, errhp_); if (res != OCI_SUCCESS) { - cleanUp(); - throw SOCIError("Cannot set username"); + clean_up(); + throw soci_error("Cannot set username"); } // set password attribute @@ -116,20 +115,20 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, passwordLen, OCI_ATTR_PASSWORD, errhp_); if (res != OCI_SUCCESS) { - cleanUp(); - throw SOCIError("Cannot set password"); + clean_up(); + throw soci_error("Cannot set password"); } // begin the session res = OCISessionBegin(svchp_, errhp_, usrhp_, - OCI_CRED_RDBMS, OCI_DEFAULT); + OCI_CRED_RDBMS, mode); if (res != OCI_SUCCESS) { std::string msg; int errNum; - getErrorDetails(res, errhp_, msg, errNum); - cleanUp(); - throw OracleSOCIError(msg, errNum); + get_error_details(res, errhp_, msg, errNum); + clean_up(); + throw oracle_soci_error(msg, errNum); } // set the session in the context handle @@ -139,77 +138,76 @@ OracleSessionBackEnd::OracleSessionBackEnd(std::string const & serviceName, { std::string msg; int errNum; - getErrorDetails(res, errhp_, msg, errNum); - cleanUp(); - throw OracleSOCIError(msg, errNum); + get_error_details(res, errhp_, msg, errNum); + clean_up(); + throw oracle_soci_error(msg, errNum); } } -OracleSessionBackEnd::~OracleSessionBackEnd() +oracle_session_backend::~oracle_session_backend() { - cleanUp(); + clean_up(); } -void OracleSessionBackEnd::begin() +void oracle_session_backend::begin() { -// This code is commented out because it causes one of the transaction -// tests in CommonTests::test10() to fail with error 'Invalid handle' -// With the code commented out, all tests pass. - -// sword res = OCITransStart(svchp_, errhp_, 0, OCI_TRANS_NEW); -// if (res != OCI_SUCCESS) -// { -// throwOracleSOCIError(res, errhp_); -// } + // This code is commented out because it causes one of the transaction + // tests in CommonTests::test10() to fail with error 'Invalid handle' + // With the code commented out, all tests pass. + // sword res = OCITransStart(svchp_, errhp_, 0, OCI_TRANS_NEW); + // if (res != OCI_SUCCESS) + // { + // throworacle_soci_error(res, errhp_); + // } } -void OracleSessionBackEnd::commit() +void oracle_session_backend::commit() { sword res = OCITransCommit(svchp_, errhp_, OCI_DEFAULT); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, errhp_); + throw_oracle_soci_error(res, errhp_); } } -void OracleSessionBackEnd::rollback() +void oracle_session_backend::rollback() { sword res = OCITransRollback(svchp_, errhp_, OCI_DEFAULT); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, errhp_); + throw_oracle_soci_error(res, errhp_); } } -void OracleSessionBackEnd::cleanUp() +void oracle_session_backend::clean_up() { if (svchp_ != NULL && errhp_ != NULL && usrhp_ != NULL) { OCISessionEnd(svchp_, errhp_, usrhp_, OCI_DEFAULT); } - if (usrhp_) OCIHandleFree(usrhp_, OCI_HTYPE_SESSION); - if (svchp_) OCIHandleFree(svchp_, OCI_HTYPE_SVCCTX); + if (usrhp_) { OCIHandleFree(usrhp_, OCI_HTYPE_SESSION); } + if (svchp_) { OCIHandleFree(svchp_, OCI_HTYPE_SVCCTX); } if (srvhp_) { OCIServerDetach(srvhp_, errhp_, OCI_DEFAULT); OCIHandleFree(srvhp_, OCI_HTYPE_SERVER); } - if (errhp_) OCIHandleFree(errhp_, OCI_HTYPE_ERROR); - if (envhp_) OCIHandleFree(envhp_, OCI_HTYPE_ENV); + if (errhp_) { OCIHandleFree(errhp_, OCI_HTYPE_ERROR); } + if (envhp_) { OCIHandleFree(envhp_, OCI_HTYPE_ENV); } } -OracleStatementBackEnd * OracleSessionBackEnd::makeStatementBackEnd() +oracle_statement_backend * oracle_session_backend::make_statement_backend() { - return new OracleStatementBackEnd(*this); + return new oracle_statement_backend(*this); } -OracleRowIDBackEnd * OracleSessionBackEnd::makeRowIDBackEnd() +oracle_rowid_backend * oracle_session_backend::make_rowid_backend() { - return new OracleRowIDBackEnd(*this); + return new oracle_rowid_backend(*this); } -OracleBLOBBackEnd * OracleSessionBackEnd::makeBLOBBackEnd() +oracle_blob_backend * oracle_session_backend::make_blob_backend() { - return new OracleBLOBBackEnd(*this); + return new oracle_blob_backend(*this); } diff --git a/src/backends/oracle/soci-oracle.h b/src/backends/oracle/soci-oracle.h index dd279635..696036ed 100644 --- a/src/backends/oracle/soci-oracle.h +++ b/src/backends/oracle/soci-oracle.h @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -23,8 +23,7 @@ # define SOCI_ORACLE_DECL #endif -// TODO - mloskot: shouldn't soci.h be replaced with soci-backend.h? -#include <soci.h> +#include <soci-backend.h> #include <oci.h> // OCI #include <vector> @@ -33,199 +32,201 @@ #endif -namespace SOCI +namespace soci { -class SOCI_ORACLE_DECL OracleSOCIError : public SOCIError +class SOCI_ORACLE_DECL oracle_soci_error : public soci_error { public: - OracleSOCIError(std::string const & msg, int errNum = 0); + oracle_soci_error(std::string const & msg, int errNum = 0); - int errNum_; + int err_num_; }; -struct OracleStatementBackEnd; -struct OracleStandardIntoTypeBackEnd : details::StandardIntoTypeBackEnd +struct oracle_statement_backend; +struct oracle_standard_into_type_backend : details::standard_into_type_backend { - OracleStandardIntoTypeBackEnd(OracleStatementBackEnd &st) + oracle_standard_into_type_backend(oracle_statement_backend &st) : statement_(st), defnp_(NULL), indOCIHolder_(0), data_(NULL), buf_(NULL) {} - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); + virtual void define_by_pos(int &position, + void *data, details::exchange_type type); - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind); + virtual void pre_fetch(); + virtual void post_fetch(bool gotData, bool calledFromFetch, + indicator *ind); - virtual void cleanUp(); + virtual void clean_up(); - OracleStatementBackEnd &statement_; + oracle_statement_backend &statement_; OCIDefine *defnp_; sb2 indOCIHolder_; void *data_; char *buf_; // generic buffer - details::eExchangeType type_; + details::exchange_type type_; ub2 rCode_; }; -struct OracleVectorIntoTypeBackEnd : details::VectorIntoTypeBackEnd +struct oracle_vector_into_type_backend : details::vector_into_type_backend { - OracleVectorIntoTypeBackEnd(OracleStatementBackEnd &st) + oracle_vector_into_type_backend(oracle_statement_backend &st) : statement_(st), defnp_(NULL), indOCIHolders_(NULL), data_(NULL), buf_(NULL) {} - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); + virtual void define_by_pos(int &position, + void *data, details::exchange_type type); - virtual void preFetch(); - virtual void postFetch(bool gotData, eIndicator *ind); + virtual void pre_fetch(); + virtual void post_fetch(bool gotData, indicator *ind); virtual void resize(std::size_t sz); virtual std::size_t size(); - virtual void cleanUp(); + virtual void clean_up(); // helper function for preparing indicators and sizes_ vectors - // (as part of the defineByPos) - void prepareIndicators(std::size_t size); + // (as part of the define_by_pos) + void prepare_indicators(std::size_t size); - OracleStatementBackEnd &statement_; + oracle_statement_backend &statement_; OCIDefine *defnp_; sb2 *indOCIHolders_; std::vector<sb2> indOCIHolderVec_; void *data_; char *buf_; // generic buffer - details::eExchangeType type_; + details::exchange_type type_; std::size_t colSize_; // size of the string column (used for strings) std::vector<ub2> sizes_; // sizes of data fetched (used for strings) std::vector<ub2> rCodes_; }; -struct OracleStandardUseTypeBackEnd : details::StandardUseTypeBackEnd +struct oracle_standard_use_type_backend : details::standard_use_type_backend { - OracleStandardUseTypeBackEnd(OracleStatementBackEnd &st) + oracle_standard_use_type_backend(oracle_statement_backend &st) : statement_(st), bindp_(NULL), indOCIHolder_(0), data_(NULL), buf_(NULL) {} - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); + virtual void bind_by_pos(int &position, + void *data, details::exchange_type type, bool readOnly); + virtual void bind_by_name(std::string const &name, + void *data, details::exchange_type type, bool readOnly); - // common part for bindByPos and bindByName - void prepareForBind(void *&data, sb4 &size, ub2 &oracleType); + // common part for bind_by_pos and bind_by_name + void prepare_for_bind(void *&data, sb4 &size, ub2 &oracleType, bool readOnly); - virtual void preUse(eIndicator const *ind); - virtual void postUse(bool gotData, eIndicator *ind); + virtual void pre_use(indicator const *ind); + virtual void post_use(bool gotData, indicator *ind); - virtual void cleanUp(); + virtual void clean_up(); - OracleStatementBackEnd &statement_; + oracle_statement_backend &statement_; OCIBind *bindp_; sb2 indOCIHolder_; void *data_; + bool readOnly_; char *buf_; // generic buffer - details::eExchangeType type_; + details::exchange_type type_; }; -struct OracleVectorUseTypeBackEnd : details::VectorUseTypeBackEnd +struct oracle_vector_use_type_backend : details::vector_use_type_backend { - OracleVectorUseTypeBackEnd(OracleStatementBackEnd &st) + oracle_vector_use_type_backend(oracle_statement_backend &st) : statement_(st), bindp_(NULL), indOCIHolders_(NULL), data_(NULL), buf_(NULL) {} - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); + virtual void bind_by_pos(int &position, + void *data, details::exchange_type type); + virtual void bind_by_name(std::string const &name, + void *data, details::exchange_type type); - // common part for bindByPos and bindByName - void prepareForBind(void *&data, sb4 &size, ub2 &oracleType); + // common part for bind_by_pos and bind_by_name + void prepare_for_bind(void *&data, sb4 &size, ub2 &oracleType); // helper function for preparing indicators and sizes_ vectors - // (as part of the bindByPos and bindByName) - void prepareIndicators(std::size_t size); + // (as part of the bind_by_pos and bind_by_name) + void prepare_indicators(std::size_t size); - virtual void preUse(eIndicator const *ind); + virtual void pre_use(indicator const *ind); virtual std::size_t size(); - virtual void cleanUp(); + virtual void clean_up(); - OracleStatementBackEnd &statement_; + oracle_statement_backend &statement_; OCIBind *bindp_; std::vector<sb2> indOCIHolderVec_; sb2 *indOCIHolders_; void *data_; char *buf_; // generic buffer - details::eExchangeType type_; + details::exchange_type type_; // used for strings only std::vector<ub2> sizes_; std::size_t maxSize_; }; -struct OracleSessionBackEnd; -struct OracleStatementBackEnd : details::StatementBackEnd +struct oracle_session_backend; +struct oracle_statement_backend : details::statement_backend { - OracleStatementBackEnd(OracleSessionBackEnd &session); + oracle_statement_backend(oracle_session_backend &session); virtual void alloc(); - virtual void cleanUp(); + virtual void clean_up(); virtual void prepare(std::string const &query, - details::eStatementType eType); + details::statement_type eType); - virtual execFetchResult execute(int number); - virtual execFetchResult fetch(int number); + virtual exec_fetch_result execute(int number); + virtual exec_fetch_result fetch(int number); - virtual int getNumberOfRows(); + virtual int get_number_of_rows(); - virtual std::string rewriteForProcedureCall(std::string const &query); + virtual std::string rewrite_for_procedure_call(std::string const &query); - virtual int prepareForDescribe(); - virtual void describeColumn(int colNum, eDataType &dtype, + virtual int prepare_for_describe(); + virtual void describe_column(int colNum, data_type &dtype, std::string &columnName); // helper for defining into vector<string> - std::size_t columnSize(int position); + std::size_t column_size(int position); - virtual OracleStandardIntoTypeBackEnd * makeIntoTypeBackEnd(); - virtual OracleStandardUseTypeBackEnd * makeUseTypeBackEnd(); - virtual OracleVectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd(); - virtual OracleVectorUseTypeBackEnd * makeVectorUseTypeBackEnd(); + virtual oracle_standard_into_type_backend * make_into_type_backend(); + virtual oracle_standard_use_type_backend * make_use_type_backend(); + virtual oracle_vector_into_type_backend * make_vector_into_type_backend(); + virtual oracle_vector_use_type_backend * make_vector_use_type_backend(); - OracleSessionBackEnd &session_; + oracle_session_backend &session_; OCIStmt *stmtp_; bool boundByName_; bool boundByPos_; + bool noData_; }; -struct OracleRowIDBackEnd : details::RowIDBackEnd +struct oracle_rowid_backend : details::rowid_backend { - OracleRowIDBackEnd(OracleSessionBackEnd &session); + oracle_rowid_backend(oracle_session_backend &session); - ~OracleRowIDBackEnd(); + ~oracle_rowid_backend(); OCIRowid *rowidp_; }; -struct OracleBLOBBackEnd : details::BLOBBackEnd +struct oracle_blob_backend : details::blob_backend { - OracleBLOBBackEnd(OracleSessionBackEnd &session); + oracle_blob_backend(oracle_session_backend &session); - ~OracleBLOBBackEnd(); + ~oracle_blob_backend(); - virtual std::size_t getLen(); + virtual std::size_t get_len(); virtual std::size_t read(std::size_t offset, char *buf, std::size_t toRead); virtual std::size_t write(std::size_t offset, char const *buf, @@ -233,28 +234,31 @@ struct OracleBLOBBackEnd : details::BLOBBackEnd virtual std::size_t append(char const *buf, std::size_t toWrite); virtual void trim(std::size_t newLen); - OracleSessionBackEnd &session_; + oracle_session_backend &session_; OCILobLocator *lobp_; }; -struct OracleSessionBackEnd : details::SessionBackEnd +struct oracle_session_backend : details::session_backend { - OracleSessionBackEnd(std::string const & serviceName, + oracle_session_backend(std::string const & serviceName, std::string const & userName, - std::string const & password); + std::string const & password, + int mode); - ~OracleSessionBackEnd(); + ~oracle_session_backend(); virtual void begin(); virtual void commit(); virtual void rollback(); - void cleanUp(); + virtual std::string get_backend_name() const { return "oracle"; } - virtual OracleStatementBackEnd * makeStatementBackEnd(); - virtual OracleRowIDBackEnd * makeRowIDBackEnd(); - virtual OracleBLOBBackEnd * makeBLOBBackEnd(); + void clean_up(); + + virtual oracle_statement_backend * make_statement_backend(); + virtual oracle_rowid_backend * make_rowid_backend(); + virtual oracle_blob_backend * make_blob_backend(); OCIEnv *envhp_; OCIServer *srvhp_; @@ -263,16 +267,22 @@ struct OracleSessionBackEnd : details::SessionBackEnd OCISession *usrhp_; }; -struct OracleBackEndFactory : BackEndFactory +struct oracle_backend_factory : backend_factory { - virtual OracleSessionBackEnd * makeSession( - std::string const &connectString) const; + virtual oracle_session_backend * make_session( + std::string const &connectString) const; }; -SOCI_ORACLE_DECL extern OracleBackEndFactory const oracle; +extern SOCI_ORACLE_DECL oracle_backend_factory const oracle; + +extern "C" +{ +// for dynamic backend loading +SOCI_ORACLE_DECL backend_factory const * factory_oracle(); -} // namespace SOCI +} // extern "C" -#endif // SOCI_ORACLE_H_INCLUDED +} // namespace soci +#endif diff --git a/src/backends/oracle/standard-into-type.cpp b/src/backends/oracle/standard-into-type.cpp index 7fffaefc..db866338 100644 --- a/src/backends/oracle/standard-into-type.cpp +++ b/src/backends/oracle/standard-into-type.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,11 +7,14 @@ #define SOCI_ORACLE_SOURCE #include "soci-oracle.h" +#include "blob.h" #include "error.h" -#include <soci.h> +#include "rowid.h" +#include "statement.h" #include <cctype> #include <cstdio> #include <cstring> +#include <cstdlib> #include <ctime> #include <sstream> @@ -19,34 +22,36 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Oracle; +using namespace soci; +using namespace soci::details; +using namespace soci::details::oracle; -OracleStandardIntoTypeBackEnd * OracleStatementBackEnd::makeIntoTypeBackEnd() +oracle_standard_into_type_backend * +oracle_statement_backend::make_into_type_backend() { - return new OracleStandardIntoTypeBackEnd(*this); + return new oracle_standard_into_type_backend(*this); } -OracleStandardUseTypeBackEnd * OracleStatementBackEnd::makeUseTypeBackEnd() +oracle_standard_use_type_backend * +oracle_statement_backend::make_use_type_backend() { - return new OracleStandardUseTypeBackEnd(*this); + return new oracle_standard_use_type_backend(*this); } -OracleVectorIntoTypeBackEnd * -OracleStatementBackEnd::makeVectorIntoTypeBackEnd() +oracle_vector_into_type_backend * +oracle_statement_backend::make_vector_into_type_backend() { - return new OracleVectorIntoTypeBackEnd(*this); + return new oracle_vector_into_type_backend(*this); } -OracleVectorUseTypeBackEnd * -OracleStatementBackEnd::makeVectorUseTypeBackEnd() +oracle_vector_use_type_backend * +oracle_statement_backend::make_vector_use_type_backend() { - return new OracleVectorUseTypeBackEnd(*this); + return new oracle_vector_use_type_backend(*this); } -void OracleStandardIntoTypeBackEnd::defineByPos( - int &position, void *data, eExchangeType type) +void oracle_standard_into_type_backend::define_by_pos( + int &position, void *data, exchange_type type) { data_ = data; // for future reference type_ = type; // for future reference @@ -57,44 +62,50 @@ void OracleStandardIntoTypeBackEnd::defineByPos( switch (type) { // simple cases - case eXChar: + case x_char: oracleType = SQLT_AFC; size = sizeof(char); break; - case eXShort: + case x_short: oracleType = SQLT_INT; size = sizeof(short); break; - case eXInteger: + case x_integer: oracleType = SQLT_INT; size = sizeof(int); break; - case eXUnsignedLong: + case x_unsigned_long: oracleType = SQLT_UIN; size = sizeof(unsigned long); break; - case eXDouble: + case x_double: oracleType = SQLT_FLT; size = sizeof(double); break; // cases that require adjustments and buffer management - case eXCString: + case x_long_long: + oracleType = SQLT_STR; + size = 100; // arbitrary buffer length + buf_ = new char[size]; + data = buf_; + break; + case x_cstring: { - details::CStringDescriptor *desc - = static_cast<CStringDescriptor *>(data); + details::cstring_descriptor *desc + = static_cast<cstring_descriptor *>(data); oracleType = SQLT_STR; data = desc->str_; size = static_cast<sb4>(desc->bufSize_); } break; - case eXStdString: + case x_stdstring: oracleType = SQLT_STR; size = 32769; // support selecting strings from LONG columns buf_ = new char[size]; data = buf_; break; - case eXStdTm: + case x_stdtm: oracleType = SQLT_DAT; size = 7 * sizeof(ub1); buf_ = new char[size]; @@ -102,40 +113,40 @@ void OracleStandardIntoTypeBackEnd::defineByPos( break; // cases that require special handling - case eXStatement: + case x_statement: { oracleType = SQLT_RSET; - Statement *st = static_cast<Statement *>(data); + statement *st = static_cast<statement *>(data); st->alloc(); - OracleStatementBackEnd *stbe - = static_cast<OracleStatementBackEnd *>(st->getBackEnd()); + oracle_statement_backend *stbe + = static_cast<oracle_statement_backend *>(st->get_backend()); size = 0; data = &stbe->stmtp_; } break; - case eXRowID: + case x_rowid: { oracleType = SQLT_RDD; - RowID *rid = static_cast<RowID *>(data); + rowid *rid = static_cast<rowid *>(data); - OracleRowIDBackEnd *rbe - = static_cast<OracleRowIDBackEnd *>(rid->getBackEnd()); + oracle_rowid_backend *rbe + = static_cast<oracle_rowid_backend *>(rid->get_backend()); size = 0; data = &rbe->rowidp_; } break; - case eXBLOB: + case x_blob: { oracleType = SQLT_BLOB; - BLOB *b = static_cast<BLOB *>(data); + blob *b = static_cast<blob *>(data); - OracleBLOBBackEnd *bbe - = static_cast<OracleBLOBBackEnd *>(b->getBackEnd()); + oracle_blob_backend *bbe + = static_cast<oracle_blob_backend *>(b->get_backend()); size = 0; data = &bbe->lobp_; @@ -150,37 +161,45 @@ void OracleStandardIntoTypeBackEnd::defineByPos( if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, statement_.session_.errhp_); + throw_oracle_soci_error(res, statement_.session_.errhp_); } } -void OracleStandardIntoTypeBackEnd::preFetch() +void oracle_standard_into_type_backend::pre_fetch() { // nothing to do except with Statement into objects - if (type_ == eXStatement) + if (type_ == x_statement) { - Statement *st = static_cast<Statement *>(data_); - st->unDefAndBind(); + statement *st = static_cast<statement *>(data_); + st->undefine_and_bind(); } } -void OracleStandardIntoTypeBackEnd::postFetch( - bool gotData, bool calledFromFetch, eIndicator *ind) +void oracle_standard_into_type_backend::post_fetch( + bool gotData, bool calledFromFetch, indicator *ind) { // first, deal with data if (gotData) { // only std::string, std::tm and Statement need special handling - if (type_ == eXStdString) + if (type_ == x_stdstring) { if (indOCIHolder_ != -1) - { + { std::string *s = static_cast<std::string *>(data_); *s = buf_; } } - else if (type_ == eXStdTm) + else if (type_ == x_long_long) + { + if (indOCIHolder_ != -1) + { + long long *v = static_cast<long long *>(data_); + *v = strtoll(buf_, NULL, 10); + } + } + else if (type_ == x_stdtm) { if (indOCIHolder_ != -1) { @@ -200,10 +219,10 @@ void OracleStandardIntoTypeBackEnd::postFetch( std::mktime(t); } } - else if (type_ == eXStatement) + else if (type_ == x_statement) { - Statement *st = static_cast<Statement *>(data_); - st->defineAndBind(); + statement *st = static_cast<statement *>(data_); + st->define_and_bind(); } } @@ -216,23 +235,19 @@ void OracleStandardIntoTypeBackEnd::postFetch( } if (ind != NULL) { - if (gotData == false) - { - *ind = eNoData; - } - else + if (gotData) { if (indOCIHolder_ == 0) { - *ind = eOK; + *ind = i_ok; } else if (indOCIHolder_ == -1) { - *ind = eNull; + *ind = i_null; } else { - *ind = eTruncated; + *ind = i_truncated; } } } @@ -241,18 +256,12 @@ void OracleStandardIntoTypeBackEnd::postFetch( if (indOCIHolder_ == -1) { // fetched null and no indicator - programming error! - throw SOCIError("Null value fetched and no indicator defined."); - } - - if (gotData == false) - { - // no data fetched and no indicator - programming error! - throw SOCIError("No data fetched and no indicator defined."); + throw soci_error("Null value fetched and no indicator defined."); } } } -void OracleStandardIntoTypeBackEnd::cleanUp() +void oracle_standard_into_type_backend::clean_up() { if (defnp_ != NULL) { @@ -266,5 +275,3 @@ void OracleStandardIntoTypeBackEnd::cleanUp() buf_ = NULL; } } - - diff --git a/src/backends/oracle/standard-use-type.cpp b/src/backends/oracle/standard-use-type.cpp index 695fad06..82579192 100644 --- a/src/backends/oracle/standard-use-type.cpp +++ b/src/backends/oracle/standard-use-type.cpp @@ -1,17 +1,20 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#define SOCI_ORACLE_SOURCE +#define soci_ORACLE_SOURCE #include "soci-oracle.h" +#include "blob.h" #include "error.h" -#include <soci.h> +#include "rowid.h" +#include "statement.h" #include <cctype> #include <cstdio> #include <cstring> +#include <cstdlib> #include <ctime> #include <sstream> @@ -19,55 +22,97 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Oracle; +using namespace soci; +using namespace soci::details; +using namespace soci::details::oracle; -void OracleStandardUseTypeBackEnd::prepareForBind( - void *&data, sb4 &size, ub2 &oracleType) +void oracle_standard_use_type_backend::prepare_for_bind( + void *&data, sb4 &size, ub2 &oracleType, bool readOnly) { + readOnly_ = readOnly; + switch (type_) { // simple cases - case eXChar: + case x_char: oracleType = SQLT_AFC; size = sizeof(char); + if (readOnly) + { + buf_ = new char[size]; + data = buf_; + } break; - case eXShort: + case x_short: oracleType = SQLT_INT; size = sizeof(short); + if (readOnly) + { + buf_ = new char[size]; + data = buf_; + } break; - case eXInteger: + case x_integer: oracleType = SQLT_INT; size = sizeof(int); + if (readOnly) + { + buf_ = new char[size]; + data = buf_; + } break; - case eXUnsignedLong: + case x_unsigned_long: oracleType = SQLT_UIN; size = sizeof(unsigned long); + if (readOnly) + { + buf_ = new char[size]; + data = buf_; + } break; - case eXDouble: + case x_double: oracleType = SQLT_FLT; size = sizeof(double); + if (readOnly) + { + buf_ = new char[size]; + data = buf_; + } break; // cases that require adjustments and buffer management - case eXCString: + case x_long_long: + oracleType = SQLT_STR; + size = 100; // arbitrary buffer length + buf_ = new char[size]; + data = buf_; + break; + case x_cstring: { - details::CStringDescriptor *desc - = static_cast<CStringDescriptor *>(data); + details::cstring_descriptor *desc + = static_cast<cstring_descriptor *>(data); oracleType = SQLT_STR; - data = desc->str_; size = static_cast<sb4>(desc->bufSize_); + + if (readOnly_) + { + buf_ = new char[size]; + data = buf_; + } + else + { + data = desc->str_; + } } break; - case eXStdString: + case x_stdstring: oracleType = SQLT_STR; // 4000 is Oracle max VARCHAR2 size; 32768 is max LONG size - size = 32769; + size = 32769; buf_ = new char[size]; data = buf_; break; - case eXStdTm: + case x_stdtm: oracleType = SQLT_DAT; size = 7 * sizeof(ub1); buf_ = new char[size]; @@ -75,40 +120,40 @@ void OracleStandardUseTypeBackEnd::prepareForBind( break; // cases that require special handling - case eXStatement: + case x_statement: { oracleType = SQLT_RSET; - Statement *st = static_cast<Statement *>(data); + statement *st = static_cast<statement *>(data); st->alloc(); - OracleStatementBackEnd *stbe - = static_cast<OracleStatementBackEnd *>(st->getBackEnd()); + oracle_statement_backend *stbe + = static_cast<oracle_statement_backend *>(st->get_backend()); size = 0; data = &stbe->stmtp_; } break; - case eXRowID: + case x_rowid: { oracleType = SQLT_RDD; - RowID *rid = static_cast<RowID *>(data); + rowid *rid = static_cast<rowid *>(data); - OracleRowIDBackEnd *rbe - = static_cast<OracleRowIDBackEnd *>(rid->getBackEnd()); + oracle_rowid_backend *rbe + = static_cast<oracle_rowid_backend *>(rid->get_backend()); size = 0; data = &rbe->rowidp_; } break; - case eXBLOB: + case x_blob: { oracleType = SQLT_BLOB; - BLOB *b = static_cast<BLOB *>(data); + blob *b = static_cast<blob *>(data); - OracleBLOBBackEnd *bbe - = static_cast<OracleBLOBBackEnd *>(b->getBackEnd()); + oracle_blob_backend *bbe + = static_cast<oracle_blob_backend *>(b->get_backend()); size = 0; data = &bbe->lobp_; @@ -117,12 +162,12 @@ void OracleStandardUseTypeBackEnd::prepareForBind( } } -void OracleStandardUseTypeBackEnd::bindByPos( - int &position, void *data, eExchangeType type) +void oracle_standard_use_type_backend::bind_by_pos( + int &position, void *data, exchange_type type, bool readOnly) { if (statement_.boundByName_) { - throw SOCIError( + throw soci_error( "Binding for use elements must be either by position or by name."); } @@ -132,7 +177,7 @@ void OracleStandardUseTypeBackEnd::bindByPos( ub2 oracleType; sb4 size; - prepareForBind(data, size, oracleType); + prepare_for_bind(data, size, oracleType, readOnly); sword res = OCIBindByPos(statement_.stmtp_, &bindp_, statement_.session_.errhp_, @@ -140,18 +185,18 @@ void OracleStandardUseTypeBackEnd::bindByPos( &indOCIHolder_, 0, 0, 0, 0, OCI_DEFAULT); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, statement_.session_.errhp_); + throw_oracle_soci_error(res, statement_.session_.errhp_); } statement_.boundByPos_ = true; } -void OracleStandardUseTypeBackEnd::bindByName( - std::string const &name, void *data, eExchangeType type) +void oracle_standard_use_type_backend::bind_by_name( + std::string const &name, void *data, exchange_type type, bool readOnly) { if (statement_.boundByPos_) { - throw SOCIError( + throw soci_error( "Binding for use elements must be either by position or by name."); } @@ -161,7 +206,7 @@ void OracleStandardUseTypeBackEnd::bindByName( ub2 oracleType; sb4 size; - prepareForBind(data, size, oracleType); + prepare_for_bind(data, size, oracleType, readOnly); sword res = OCIBindByName(statement_.stmtp_, &bindp_, statement_.session_.errhp_, @@ -171,49 +216,105 @@ void OracleStandardUseTypeBackEnd::bindByName( &indOCIHolder_, 0, 0, 0, 0, OCI_DEFAULT); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, statement_.session_.errhp_); + throw_oracle_soci_error(res, statement_.session_.errhp_); } statement_.boundByName_ = true; } -void OracleStandardUseTypeBackEnd::preUse(eIndicator const *ind) +void oracle_standard_use_type_backend::pre_use(indicator const *ind) { // first deal with data - if (type_ == eXStdString) - { - std::string *s = static_cast<std::string *>(data_); - - // 4000 is Oracle max VARCHAR2 size; 32768 is max LONG size - std::size_t const bufSize = 32769; - std::size_t const sSize = s->size(); - std::size_t const toCopy = - sSize < bufSize -1 ? sSize + 1 : bufSize - 1; - strncpy(buf_, s->c_str(), toCopy); - buf_[toCopy] = '\0'; - } - else if (type_ == eXStdTm) - { - std::tm *t = static_cast<std::tm *>(data_); - ub1* pos = reinterpret_cast<ub1*>(buf_); - - *pos++ = static_cast<ub1>(100 + (1900 + t->tm_year) / 100); - *pos++ = static_cast<ub1>(100 + t->tm_year % 100); - *pos++ = static_cast<ub1>(t->tm_mon + 1); - *pos++ = static_cast<ub1>(t->tm_mday); - *pos++ = static_cast<ub1>(t->tm_hour + 1); - *pos++ = static_cast<ub1>(t->tm_min + 1); - *pos = static_cast<ub1>(t->tm_sec + 1); - } - else if (type_ == eXStatement) + switch (type_) { - Statement *s = static_cast<Statement *>(data_); + case x_char: + if (readOnly_) + { + buf_[0] = *static_cast<char *>(data_); + } + break; + case x_short: + if (readOnly_) + { + *static_cast<short *>(static_cast<void *>(buf_)) = *static_cast<short *>(data_); + } + break; + case x_integer: + if (readOnly_) + { + *static_cast<int *>(static_cast<void *>(buf_)) = *static_cast<int *>(data_); + } + break; + case x_unsigned_long: + if (readOnly_) + { + *static_cast<unsigned long *>(static_cast<void *>(buf_)) + = *static_cast<unsigned long *>(data_); + } + break; + case x_long_long: + { + size_t const size = 100; // arbitrary, but consistent with prepare_for_bind + snprintf(buf_, size, "%lld", *static_cast<long long *>(data_)); + } + break; + case x_double: + if (readOnly_) + { + *static_cast<double *>(static_cast<void *>(buf_)) = *static_cast<double *>(data_); + } + break; + case x_cstring: + if (readOnly_) + { + details::cstring_descriptor *desc + = static_cast<cstring_descriptor *>(data_); - s->unDefAndBind(); + strcpy(buf_, desc->str_); + } + break; + case x_stdstring: + { + std::string *s = static_cast<std::string *>(data_); + + // 4000 is Oracle max VARCHAR2 size; 32768 is max LONG size + std::size_t const bufSize = 32769; + std::size_t const sSize = s->size(); + std::size_t const toCopy = + sSize < bufSize -1 ? sSize + 1 : bufSize - 1; + strncpy(buf_, s->c_str(), toCopy); + buf_[toCopy] = '\0'; + } + break; + case x_stdtm: + { + std::tm *t = static_cast<std::tm *>(data_); + ub1* pos = reinterpret_cast<ub1*>(buf_); + + *pos++ = static_cast<ub1>(100 + (1900 + t->tm_year) / 100); + *pos++ = static_cast<ub1>(100 + t->tm_year % 100); + *pos++ = static_cast<ub1>(t->tm_mon + 1); + *pos++ = static_cast<ub1>(t->tm_mday); + *pos++ = static_cast<ub1>(t->tm_hour + 1); + *pos++ = static_cast<ub1>(t->tm_min + 1); + *pos = static_cast<ub1>(t->tm_sec + 1); + } + break; + case x_statement: + { + statement *s = static_cast<statement *>(data_); + + s->undefine_and_bind(); + } + break; + case x_rowid: + case x_blob: + // nothing to do + break; } // then handle indicators - if (ind != NULL && *ind == eNull) + if (ind != NULL && *ind == i_null) { indOCIHolder_ = -1; // null } @@ -223,80 +324,193 @@ void OracleStandardUseTypeBackEnd::preUse(eIndicator const *ind) } } -void OracleStandardUseTypeBackEnd::postUse(bool gotData, eIndicator *ind) +void oracle_standard_use_type_backend::post_use(bool gotData, indicator *ind) { + // It is possible to have the bound element being overwritten + // by the database. + // + // With readOnly_ == true the propagation of modification should *not* + // take place and in addition the attempt of modification should be detected and reported. + // first, deal with data if (gotData) { - if (type_ == eXStdString) + switch (type_) { - std::string *s = static_cast<std::string *>(data_); + case x_char: + if (readOnly_) + { + const char original = *static_cast<char *>(data_); + const char bound = buf_[0]; - *s = buf_; - } - else if (type_ == eXStdTm) - { - std::tm *t = static_cast<std::tm *>(data_); + if (original != bound) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; + case x_short: + if (readOnly_) + { + const short original = *static_cast<short *>(data_); + const short bound = *static_cast<short *>(static_cast<void *>(buf_)); - ub1 *pos = reinterpret_cast<ub1*>(buf_); - t->tm_isdst = -1; - t->tm_year = (*pos++ - 100) * 100; - t->tm_year += *pos++ - 2000; - t->tm_mon = *pos++ - 1; - t->tm_mday = *pos++; - t->tm_hour = *pos++ - 1; - t->tm_min = *pos++ - 1; - t->tm_sec = *pos++ - 1; - - // normalize and compute the remaining fields - std::mktime(t); - } - else if (type_ == eXStatement) - { - Statement *s = static_cast<Statement *>(data_); - s->defineAndBind(); + if (original != bound) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; + case x_integer: + if (readOnly_) + { + const int original = *static_cast<int *>(data_); + const int bound = *static_cast<int *>(static_cast<void *>(buf_)); + + if (original != bound) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; + case x_unsigned_long: + if (readOnly_) + { + const unsigned long original = *static_cast<unsigned long *>(data_); + const unsigned long bound + = *static_cast<unsigned long *>(static_cast<void *>(buf_)); + + if (original != bound) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; + case x_long_long: + if (readOnly_) + { + long long const original = *static_cast<long long *>(data_); + long long const bound = strtoll(buf_, NULL, 10); + + if (original != bound) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; + case x_double: + if (readOnly_) + { + const double original = *static_cast<double *>(data_); + const double bound = *static_cast<double *>(static_cast<void *>(buf_)); + + if (original != bound) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; + case x_cstring: + if (readOnly_) + { + details::cstring_descriptor *original_descr + = static_cast<cstring_descriptor *>(data_); + + char * original = original_descr->str_; + char * bound = buf_; + + if (strcmp(original, bound) != 0) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; + case x_stdstring: + { + std::string & original = *static_cast<std::string *>(data_); + if (original != buf_) + { + if (readOnly_) + { + throw soci_error("Attempted modification of const use element"); + } + else + { + original = buf_; + } + } + } + break; + case x_stdtm: + { + std::tm & original = *static_cast<std::tm *>(data_); + + std::tm bound; + ub1 *pos = reinterpret_cast<ub1*>(buf_); + bound.tm_isdst = -1; + bound.tm_year = (*pos++ - 100) * 100; + bound.tm_year += *pos++ - 2000; + bound.tm_mon = *pos++ - 1; + bound.tm_mday = *pos++; + bound.tm_hour = *pos++ - 1; + bound.tm_min = *pos++ - 1; + bound.tm_sec = *pos++ - 1; + + if (original.tm_year != bound.tm_year || + original.tm_mon != bound.tm_mon || + original.tm_mday != bound.tm_mday || + original.tm_hour != bound.tm_hour || + original.tm_min != bound.tm_min || + original.tm_sec != bound.tm_sec) + { + if (readOnly_) + { + throw soci_error("Attempted modification of const use element"); + } + else + { + original = bound; + + // normalize and compute the remaining fields + std::mktime(&original); + } + } + } + break; + case x_statement: + { + statement *s = static_cast<statement *>(data_); + s->define_and_bind(); + } + break; + case x_rowid: + case x_blob: + // nothing to do here + break; } } if (ind != NULL) { - if (gotData == false) - { - *ind = eNoData; - } - else + if (gotData) { if (indOCIHolder_ == 0) { - *ind = eOK; + *ind = i_ok; } else if (indOCIHolder_ == -1) { - *ind = eNull; + *ind = i_null; } else { - *ind = eTruncated; + *ind = i_truncated; } } } - else - { - if (indOCIHolder_ == -1) - { - // fetched null and no indicator - programming error! - throw SOCIError("Null value fetched and no indicator defined."); - } - - if (gotData == false) - { - // no data fetched and no indicator - programming error! - throw SOCIError("No data fetched and no indicator defined."); - } - } } -void OracleStandardUseTypeBackEnd::cleanUp() +void oracle_standard_use_type_backend::clean_up() { if (bindp_ != NULL) { diff --git a/src/backends/oracle/statement.cpp b/src/backends/oracle/statement.cpp index 3de446f4..773fd815 100644 --- a/src/backends/oracle/statement.cpp +++ b/src/backends/oracle/statement.cpp @@ -1,14 +1,15 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#define SOCI_ORACLE_SOURCE +#define soci_ORACLE_SOURCE + #include "soci-oracle.h" #include "error.h" -#include <soci.h> +#include <soci-backend.h> #include <cctype> #include <cstdio> #include <cstring> @@ -20,27 +21,28 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Oracle; +using namespace soci; +using namespace soci::details; +using namespace soci::details::oracle; -OracleStatementBackEnd::OracleStatementBackEnd(OracleSessionBackEnd &session) - : session_(session), stmtp_(NULL), boundByName_(false), boundByPos_(false) +oracle_statement_backend::oracle_statement_backend(oracle_session_backend &session) + : session_(session), stmtp_(NULL), boundByName_(false), boundByPos_(false), + noData_(false) { } -void OracleStatementBackEnd::alloc() +void oracle_statement_backend::alloc() { sword res = OCIHandleAlloc(session_.envhp_, reinterpret_cast<dvoid**>(&stmtp_), OCI_HTYPE_STMT, 0, 0); if (res != OCI_SUCCESS) { - throw SOCIError("Cannot allocate statement handle"); + throw soci_error("Cannot allocate statement handle"); } } -void OracleStatementBackEnd::cleanUp() +void oracle_statement_backend::clean_up() { // deallocate statement handle if (stmtp_ != NULL) @@ -50,11 +52,11 @@ void OracleStatementBackEnd::cleanUp() } boundByName_ = false; - boundByPos_ = false; + boundByPos_ = false; } -void OracleStatementBackEnd::prepare(std::string const &query, - eStatementType /* eType */) +void oracle_statement_backend::prepare(std::string const &query, + statement_type /* eType */) { sb4 stmtLen = static_cast<sb4>(query.size()); sword res = OCIStmtPrepare(stmtp_, @@ -63,51 +65,58 @@ void OracleStatementBackEnd::prepare(std::string const &query, stmtLen, OCI_V7_SYNTAX, OCI_DEFAULT); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } } -StatementBackEnd::execFetchResult OracleStatementBackEnd::execute(int number) +statement_backend::exec_fetch_result oracle_statement_backend::execute(int number) { sword res = OCIStmtExecute(session_.svchp_, stmtp_, session_.errhp_, static_cast<ub4>(number), 0, 0, 0, OCI_DEFAULT); if (res == OCI_SUCCESS || res == OCI_SUCCESS_WITH_INFO) { - return eSuccess; + return ef_success; } else if (res == OCI_NO_DATA) { - return eNoData; + noData_ = true; + return ef_no_data; } else { - throwOracleSOCIError(res, session_.errhp_); - return eNoData; // unreachable dummy return to please the compiler + throw_oracle_soci_error(res, session_.errhp_); + return ef_no_data; // unreachable dummy return to please the compiler } } -StatementBackEnd::execFetchResult OracleStatementBackEnd::fetch(int number) +statement_backend::exec_fetch_result oracle_statement_backend::fetch(int number) { + if (noData_) + { + return ef_no_data; + } + sword res = OCIStmtFetch(stmtp_, session_.errhp_, static_cast<ub4>(number), OCI_FETCH_NEXT, OCI_DEFAULT); if (res == OCI_SUCCESS || res == OCI_SUCCESS_WITH_INFO) { - return eSuccess; + return ef_success; } else if (res == OCI_NO_DATA) { - return eNoData; + noData_ = true; + return ef_no_data; } else { - throwOracleSOCIError(res, session_.errhp_); - return eNoData; // unreachable dummy return to please the compiler + throw_oracle_soci_error(res, session_.errhp_); + return ef_no_data; // unreachable dummy return to please the compiler } } -int OracleStatementBackEnd::getNumberOfRows() +int oracle_statement_backend::get_number_of_rows() { int rows; sword res = OCIAttrGet(static_cast<dvoid*>(stmtp_), @@ -116,13 +125,13 @@ int OracleStatementBackEnd::getNumberOfRows() if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } return rows; } -std::string OracleStatementBackEnd::rewriteForProcedureCall( +std::string oracle_statement_backend::rewrite_for_procedure_call( std::string const &query) { std::string newQuery("begin "); @@ -131,13 +140,13 @@ std::string OracleStatementBackEnd::rewriteForProcedureCall( return newQuery; } -int OracleStatementBackEnd::prepareForDescribe() +int oracle_statement_backend::prepare_for_describe() { sword res = OCIStmtExecute(session_.svchp_, stmtp_, session_.errhp_, 1, 0, 0, 0, OCI_DESCRIBE_ONLY); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } int cols; @@ -147,13 +156,13 @@ int OracleStatementBackEnd::prepareForDescribe() if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } return cols; } -void OracleStatementBackEnd::describeColumn(int colNum, eDataType &type, +void oracle_statement_backend::describe_column(int colNum, data_type &type, std::string &columnName) { int size; @@ -177,7 +186,7 @@ void OracleStatementBackEnd::describeColumn(int colNum, eDataType &type, static_cast<ub4>(colNum)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } // Get the column name @@ -189,7 +198,7 @@ void OracleStatementBackEnd::describeColumn(int colNum, eDataType &type, reinterpret_cast<OCIError*>(session_.errhp_)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } // Get the column type @@ -201,7 +210,7 @@ void OracleStatementBackEnd::describeColumn(int colNum, eDataType &type, reinterpret_cast<OCIError*>(session_.errhp_)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } // get the data size @@ -213,7 +222,7 @@ void OracleStatementBackEnd::describeColumn(int colNum, eDataType &type, reinterpret_cast<OCIError*>(session_.errhp_)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } // get the precision @@ -225,7 +234,7 @@ void OracleStatementBackEnd::describeColumn(int colNum, eDataType &type, reinterpret_cast<OCIError*>(session_.errhp_)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } // get the scale @@ -237,7 +246,7 @@ void OracleStatementBackEnd::describeColumn(int colNum, eDataType &type, reinterpret_cast<OCIError*>(session_.errhp_)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } columnName.assign(dbname, dbname + nameLength); @@ -249,29 +258,29 @@ void OracleStatementBackEnd::describeColumn(int colNum, eDataType &type, { case SQLT_CHR: case SQLT_AFC: - type = eString; + type = dt_string; break; case SQLT_NUM: if (scale > 0) { - type = eDouble; + type = dt_double; } else if (precision < std::numeric_limits<int>::digits10) { - type = eInteger; + type = dt_integer; } else { - type = eUnsignedLong; + type = dt_long_long; } break; case SQLT_DAT: - type = eDate; + type = dt_date; break; } } -std::size_t OracleStatementBackEnd::columnSize(int position) +std::size_t oracle_statement_backend::column_size(int position) { // Note: we may want to optimize so that the OCI_DESCRIBE_ONLY call // happens only once per statement. @@ -284,7 +293,7 @@ std::size_t OracleStatementBackEnd::columnSize(int position) session_.errhp_, 1, 0, 0, 0, OCI_DESCRIBE_ONLY); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } // Get The Column Handle @@ -296,7 +305,7 @@ std::size_t OracleStatementBackEnd::columnSize(int position) static_cast<ub4>(position)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } // Get The Data Size @@ -308,7 +317,7 @@ std::size_t OracleStatementBackEnd::columnSize(int position) reinterpret_cast<OCIError*>(session_.errhp_)); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, session_.errhp_); + throw_oracle_soci_error(res, session_.errhp_); } return static_cast<std::size_t>(colSize); diff --git a/src/backends/oracle/test/Makefile.am b/src/backends/oracle/test/Makefile.am deleted file mode 100644 index 8ff4a9d7..00000000 --- a/src/backends/oracle/test/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/core/test \ - -I$(top_srcdir)/src/backends/oracle - -AM_CPPFLAGS = @ORACLE_OCI_CFLAGS@ -AM_LDFLAGS = @ORACLE_OCI_LDFLAGS@ - -noinst_PROGRAMS = \ - test_oracle - -test_oracle_SOURCES = \ - test-oracle.cpp - -test_oracle_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/oracle/lib@SOCI_ORACLE_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/oracle/test/Makefile.basic b/src/backends/oracle/test/Makefile.basic index b3e1e1ff..c0caf3b7 100644 --- a/src/backends/oracle/test/Makefile.basic +++ b/src/backends/oracle/test/Makefile.basic @@ -1,9 +1,9 @@ # The following variable is specific to this backend and its correct # values might depend on your environment - feel free to set it accordingly. -ORACLEINCLUDEDIR = -I/u01/oracle/product/10.1.0/rdbms/public -ORACLELIBDIR = -L/u01/oracle/product/10.1.0/lib -ORACLELIBS = -lclntsh +ORACLEINCLUDEDIR = -I/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public +ORACLELIBDIR = -L/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib +ORACLELIBS = -lclntsh -lnnz10 # The rest of the Makefile is indepentent of the target environment. @@ -11,7 +11,7 @@ COMPILER = g++ CXXFLAGS = -Wall -pedantic -Wno-long-long INCLUDEDIRS = -I.. -I../../../core -I../../../core/test ${ORACLEINCLUDEDIR} LIBDIRS = -L.. -L../../../core ${ORACLELIBDIR} -LIBS = -lsoci-core -lsoci-oracle ${ORACLELIBS} +LIBS = -lsoci_core -lsoci_oracle -ldl -lboost_date_time ${ORACLELIBS} test-oracle : test-oracle.cpp diff --git a/src/backends/oracle/test/Makefile.in b/src/backends/oracle/test/Makefile.in deleted file mode 100644 index 8e1e6918..00000000 --- a/src/backends/oracle/test/Makefile.in +++ /dev/null @@ -1,484 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -noinst_PROGRAMS = test_oracle$(EXEEXT) -subdir = src/backends/oracle/test -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_test_oracle_OBJECTS = test-oracle.$(OBJEXT) -test_oracle_OBJECTS = $(am_test_oracle_OBJECTS) -test_oracle_DEPENDENCIES = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/oracle/lib@SOCI_ORACLE_LIBRARY_NAME@.la -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(test_oracle_SOURCES) -DIST_SOURCES = $(test_oracle_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:31 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/core/test \ - -I$(top_srcdir)/src/backends/oracle - -AM_CPPFLAGS = @ORACLE_OCI_CFLAGS@ -AM_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -test_oracle_SOURCES = \ - test-oracle.cpp - -test_oracle_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/oracle/lib@SOCI_ORACLE_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/oracle/test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/oracle/test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_oracle$(EXEEXT): $(test_oracle_OBJECTS) $(test_oracle_DEPENDENCIES) - @rm -f test_oracle$(EXEEXT) - $(CXXLINK) $(test_oracle_LDFLAGS) $(test_oracle_OBJECTS) $(test_oracle_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-oracle.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/oracle/test/test-oracle.cpp b/src/backends/oracle/test/test-oracle.cpp index 8c182b19..5aab8b40 100644 --- a/src/backends/oracle/test/test-oracle.cpp +++ b/src/backends/oracle/test/test-oracle.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// // Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -13,16 +13,16 @@ #include <cassert> #include <ctime> -using namespace SOCI; -using namespace SOCI::tests; +using namespace soci; +using namespace soci::tests; std::string connectString; -BackEndFactory const &backEnd = oracle; +backend_factory const &backEnd = oracle; // Extra tests for date/time void test1() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); { std::time_t now = std::time(NULL); @@ -55,7 +55,7 @@ void test1() into(t1), use(t2); assert(memcmp(&t1, &t2, sizeof(std::tm)) == 0); - + // make sure the date is stored properly in Oracle char buf[25]; strftime(buf, sizeof(buf), "%m-%d-%Y %H:%M:%S", &t2); @@ -74,26 +74,26 @@ void test1() // explicit calls test void test2() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); - Statement st(sql); + statement st(sql); st.alloc(); int i = 0; st.exchange(into(i)); st.prepare("select 7 from dual"); - st.defineAndBind(); + st.define_and_bind(); st.execute(1); assert(i == 7); std::cout << "test 2 passed" << std::endl; } -// DDL + BLOB test +// DDL + blob test -struct BlobTableCreator : public TableCreatorBase +struct blob_table_creator : public table_creator_base { - BlobTableCreator(Session& session) - : TableCreatorBase(session) + blob_table_creator(session& session) + : table_creator_base(session) { session << "create table soci_test (" @@ -105,45 +105,45 @@ struct BlobTableCreator : public TableCreatorBase void test3() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); - BlobTableCreator tableCreator(sql); + blob_table_creator tableCreator(sql); char buf[] = "abcdefghijklmnopqrstuvwxyz"; sql << "insert into soci_test (id, img) values (7, empty_blob())"; { - BLOB b(sql); + blob b(sql); - OracleSessionBackEnd *sessionBackEnd - = static_cast<OracleSessionBackEnd *>(sql.getBackEnd()); + oracle_session_backend *sessionBackEnd + = static_cast<oracle_session_backend *>(sql.get_backend()); - OracleBLOBBackEnd *blobBackEnd - = static_cast<OracleBLOBBackEnd *>(b.getBackEnd()); + oracle_blob_backend *blobBackEnd + = static_cast<oracle_blob_backend *>(b.get_backend()); OCILobDisableBuffering(sessionBackEnd->svchp_, sessionBackEnd->errhp_, blobBackEnd->lobp_); sql << "select img from soci_test where id = 7", into(b); - assert(b.getLen() == 0); + assert(b.get_len() == 0); - // note: BLOB offsets start from 1 + // note: blob offsets start from 1 b.write(1, buf, sizeof(buf)); - assert(b.getLen() == sizeof(buf)); + assert(b.get_len() == sizeof(buf)); b.trim(10); - assert(b.getLen() == 10); + assert(b.get_len() == 10); // append does not work (Oracle bug #886191 ?) //b.append(buf, sizeof(buf)); - //assert(b.getLen() == sizeof(buf) + 10); + //assert(b.get_len() == sizeof(buf) + 10); sql.commit(); } { - BLOB b(sql); + blob b(sql); sql << "select img from soci_test where id = 7", into(b); - //assert(b.getLen() == sizeof(buf) + 10); - assert(b.getLen() == 10); + //assert(b.get_len() == sizeof(buf) + 10); + assert(b.get_len() == 10); char buf2[100]; b.read(1, buf2, 10); assert(strncmp(buf2, "abcdefghij", 10) == 0); @@ -155,12 +155,12 @@ void test3() // nested statement test // (the same syntax is used for output cursors in PL/SQL) -struct BasicTableCreator : public TableCreatorBase +struct basic_table_creator : public table_creator_base { - BasicTableCreator(Session& session) - : TableCreatorBase(session) + basic_table_creator(session& session) + : table_creator_base(session) { - session << + session << "create table soci_test (" " id number(5) not null," " name varchar2(100)," @@ -171,13 +171,13 @@ struct BasicTableCreator : public TableCreatorBase void test4() { - Session sql(backEnd, connectString); - BasicTableCreator tableCreator(sql); + session sql(backEnd, connectString); + basic_table_creator tableCreator(sql); int id; std::string name; { - Statement st1 = (sql.prepare << + statement st1 = (sql.prepare << "insert into soci_test (id, name) values (:id, :name)", use(id), use(name)); @@ -186,8 +186,8 @@ void test4() id = 3; name = "Mike"; st1.execute(1); } - Statement stInner(sql); - Statement stOuter = (sql.prepare << + statement stInner(sql); + statement stOuter = (sql.prepare << "select cursor(select name from soci_test order by id)" " from soci_test where id = 1", into(stInner)); @@ -206,15 +206,16 @@ void test4() std::cout << "test 4 passed" << std::endl; } + // ROWID test void test5() { - Session sql(backEnd, connectString); - BasicTableCreator tableCreator(sql); + session sql(backEnd, connectString); + basic_table_creator tableCreator(sql); sql << "insert into soci_test(id, name) values(7, \'John\')"; - RowID rid(sql); + rowid rid(sql); sql << "select rowid from soci_test where id = 7", into(rid); int id; @@ -228,28 +229,28 @@ void test5() std::cout << "test 5 passed" << std::endl; } -// Stored Procedures -struct ProcedureCreator : ProcedureCreatorBase +// Stored procedures +struct procedure_creator : procedure_creator_base { - ProcedureCreator(Session& session) - : ProcedureCreatorBase(session) + procedure_creator(session& session) + : procedure_creator_base(session) { - session << + session << "create or replace procedure soci_test(output out varchar2," "input in varchar2) as " "begin output := input; end;"; } }; - + void test6() { { - Session sql(backEnd, connectString); - ProcedureCreator procedureCreator(sql); + session sql(backEnd, connectString); + procedure_creator procedure_creator(sql); std::string in("my message"); std::string out; - Statement st = (sql.prepare << + statement st = (sql.prepare << "begin soci_test(:output, :input); end;", use(out, "output"), use(in, "input")); @@ -260,7 +261,7 @@ void test6() { std::string in("my message2"); std::string out; - Procedure proc = (sql.prepare << + procedure proc = (sql.prepare << "soci_test(:output, :input)", use(out, "output"), use(in, "input")); proc.execute(1); @@ -272,86 +273,95 @@ void test6() } // bind into user-defined objects -struct StringHolder +struct string_holder { - StringHolder() {} - StringHolder(const char* s) : s_(s) {} - StringHolder(std::string s) : s_(s) {} - std::string get() { return s_; } + string_holder() {} + string_holder(const char* s) : s_(s) {} + string_holder(std::string s) : s_(s) {} + std::string get() const { return s_; } private: std::string s_; }; -namespace SOCI +namespace soci { - template<> - struct TypeConversion<StringHolder> + template <> + struct type_conversion<string_holder> { typedef std::string base_type; - static StringHolder from(std::string& s) { return StringHolder(s); } - static std::string to(StringHolder& sh) { return sh.get(); } + static void from_base(const std::string &s, indicator /* ind */, + string_holder &sh) + { + sh = string_holder(s); + } + + static void to_base(const string_holder &sh, std::string &s, indicator &ind) + { + s = sh.get(); + ind = i_ok; + } }; } -struct InOutProcedureCreator : public ProcedureCreatorBase +struct in_out_procedure_creator : public procedure_creator_base { - InOutProcedureCreator(Session& session) - : ProcedureCreatorBase(session) + in_out_procedure_creator(session& session) + : procedure_creator_base(session) { session << "create or replace procedure soci_test(s in out varchar2)" " as begin s := s || s; end;"; } }; -struct ReturnsNullProcedureCreator : public ProcedureCreatorBase +struct returns_null_procedure_creator : public procedure_creator_base { - ReturnsNullProcedureCreator(Session& session) - : ProcedureCreatorBase(session) + returns_null_procedure_creator(session& session) + : procedure_creator_base(session) { session << "create or replace procedure soci_test(s in out varchar2)" - " as begin s := NULL; end;"; + " as begin s := NULL; end;"; } }; void test7() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); { - BasicTableCreator tableCreator(sql); + basic_table_creator tableCreator(sql); int id(1); - StringHolder in("my string"); + string_holder in("my string"); sql << "insert into soci_test(id, name) values(:id, :name)", use(id), use(in); - StringHolder out; + string_holder out; sql << "select name from soci_test", into(out); assert(out.get() == "my string"); - Row r; + row r; sql << "select * from soci_test", into(r); - StringHolder dynamicOut = r.get<StringHolder>(1); + string_holder dynamicOut = r.get<string_holder>(1); assert(dynamicOut.get() == "my string"); } - // test procedure with user-defined type as in-out parameter + // test procedure with user-defined type as in-out parameter { - InOutProcedureCreator procedureCreator(sql); + in_out_procedure_creator procedureCreator(sql); - StringHolder sh("test"); - Procedure proc = (sql.prepare << "soci_test(:s)", use(sh)); + string_holder sh("test"); + procedure proc = (sql.prepare << "soci_test(:s)", use(sh)); proc.execute(1); assert(sh.get() == "testtest"); } // test procedure which returns null { - ReturnsNullProcedureCreator procedureCreator(sql); + returns_null_procedure_creator procedureCreator(sql); - StringHolder sh; - eIndicator ind = eOK; - Procedure proc = (sql.prepare << "soci_test(:s)", use(sh, ind)); + string_holder sh; + indicator ind = i_ok; + procedure proc = (sql.prepare << "soci_test(:s)", use(sh, ind)); proc.execute(1); - assert(ind == eNull); + assert(ind == i_null); } std::cout << "test 7 passed" << std::endl; @@ -360,11 +370,11 @@ void test7() // test bulk insert features void test8() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); - BasicTableCreator tableCreator(sql); + basic_table_creator tableCreator(sql); - // verify exception if thrown if vectors of unequal size are passed in + // verify exception is thrown if vectors of unequal size are passed in { std::vector<int> ids; ids.push_back(1); @@ -378,7 +388,7 @@ void test8() sql << "insert into soci_test(id,code) values(:id,:code)", use(ids), use(codes); } - catch (SOCIError const &e) + catch (soci_error const &e) { error = e.what(); } @@ -408,7 +418,7 @@ void test8() { sql << "insert into soci_test (id) values(:id)", use(ids, "id"); } - catch (SOCIError const &e) + catch (soci_error const &e) { error = e.what(); //TODO e could be made to tell which row(s) failed @@ -429,7 +439,7 @@ void test8() ids.push_back(i+10); } - Statement st = (sql.prepare << "insert into soci_test(id) values(:id)", + statement st = (sql.prepare << "insert into soci_test(id) values(:id)", use(ids)); st.execute(1); int count; @@ -445,7 +455,7 @@ void test8() { sql << "select id from soci_test", into(ids); } - catch (SOCIError const &) + catch (soci_error const &) { caught = true; } @@ -460,7 +470,7 @@ void test8() { sql << "insert into soci_test(id) values(:id)", use(ids); } - catch (SOCIError const &) + catch (soci_error const &) { caught = true; } @@ -469,13 +479,13 @@ void test8() // test "no data" condition { - std::vector<eIndicator> inds(3); + std::vector<indicator> inds(3); std::vector<int> ids_out(3); - Statement st = (sql.prepare << "select id from soci_test where 1=0", + statement st = (sql.prepare << "select id from soci_test where 1=0", into(ids_out, inds)); // false return value means "no data" - assert(!st.execute(1)); + assert(st.execute(1) == false); // that's it - nothing else is guaranteed // and nothing else is to be tested here @@ -486,10 +496,10 @@ void test8() std::vector<int> ids(3); sql << "select id from soci_test", into(ids); - std::vector<eIndicator> inds_in; - inds_in.push_back(eOK); - inds_in.push_back(eNull); - inds_in.push_back(eOK); + std::vector<indicator> inds_in; + inds_in.push_back(i_ok); + inds_in.push_back(i_null); + inds_in.push_back(i_ok); std::vector<int> new_codes; new_codes.push_back(10); @@ -499,14 +509,14 @@ void test8() sql << "update soci_test set code = :code where id = :id", use(new_codes, inds_in), use(ids); - std::vector<eIndicator> inds_out(3); + std::vector<indicator> inds_out(3); std::vector<int> codes(3); sql << "select code from soci_test", into(codes, inds_out); assert(codes.size() == 3 && inds_out.size() == 3); assert(codes[0] == 10 && codes[2] == 10); - assert(inds_out[0] == eOK && inds_out[1] == eNull - && inds_out[2] == eOK); + assert(inds_out[0] == i_ok && inds_out[1] == i_null + && inds_out[2] == i_ok); } // verify an exception is thrown if null is selected @@ -518,7 +528,7 @@ void test8() { sql << "select code from soci_test", into(intos); } - catch (SOCIError const &e) + catch (soci_error const &e) { msg = e.what(); } @@ -528,40 +538,45 @@ void test8() // test basic select { const size_t sz = 3; - std::vector<eIndicator> inds(sz); + std::vector<indicator> inds(sz); std::vector<int> ids_out(sz); - Statement st = (sql.prepare << "select id from soci_test", + statement st = (sql.prepare << "select id from soci_test", into(ids_out, inds)); - assert(st.execute(1)); + const bool gotData = st.execute(true); + assert(gotData); assert(ids_out.size() == sz); assert(ids_out[0] == 10); assert(ids_out[2] == 12); - assert(inds.size() == 3 && inds[0] == eOK - && inds[1] == eOK && inds[2] == eOK); + assert(inds.size() == 3 && inds[0] == i_ok + && inds[1] == i_ok && inds[2] == i_ok); } // verify execute(0) { std::vector<int> ids_out(2); - Statement st = (sql.prepare << "select id from soci_test", + statement st = (sql.prepare << "select id from soci_test", into(ids_out)); - st.execute(0); + st.execute(); assert(ids_out.size() == 2); - assert(st.fetch()); + bool gotData = st.fetch(); + assert(gotData); assert(ids_out.size() == 2 && ids_out[0] == 10 && ids_out[1] == 11); - assert(st.fetch()); + gotData = st.fetch(); + assert(gotData); assert(ids_out.size() == 1 && ids_out[0] == 12); - assert(!st.fetch()); + gotData = st.fetch(); + assert(gotData == false); } // verify resizing happens if vector is larger // than number of rows returned { std::vector<int> ids_out(4); // one too many - Statement st2 = (sql.prepare << "select id from soci_test", + statement st2 = (sql.prepare << "select id from soci_test", into(ids_out)); - assert(st2.execute(1)); + bool gotData = st2.execute(true); + assert(gotData); assert(ids_out.size() == 3); assert(ids_out[0] == 10); assert(ids_out[2] == 12); @@ -575,20 +590,24 @@ void test8() sql << "insert into soci_test(id) values(:id)", use(more); std::vector<int> ids(2); - Statement st3 = (sql.prepare << "select id from soci_test", into(ids)); - assert(st3.execute(1)); + statement st3 = (sql.prepare << "select id from soci_test", into(ids)); + bool gotData = st3.execute(true); + assert(gotData); assert(ids[0] == 10); assert(ids[1] == 11); - assert(st3.fetch()); + gotData = st3.fetch(); + assert(gotData); assert(ids[0] == 12); assert(ids[1] == 13); - assert(st3.fetch()); + gotData = st3.fetch(); + assert(gotData); assert(ids.size() == 1); assert(ids[0] == 14); - assert(!st3.fetch()); + gotData = st3.fetch(); + assert(gotData == false); } std::cout << "test 8 passed" << std::endl; @@ -597,9 +616,9 @@ void test8() // more tests for bulk fetch void test9() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); - BasicTableCreator tableCreator(sql); + basic_table_creator tableCreator(sql); std::vector<int> in; for (int i = 1; i <= 10; ++i) @@ -618,7 +637,7 @@ void test9() // at the time of binding { std::vector<int> out(4); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select id from soci_test", into(out)); st.execute(); @@ -635,7 +654,7 @@ void test9() st.fetch(); assert(false); // should never reach here } - catch (SOCIError const &e) + catch (soci_error const &e) { assert(std::string(e.what()) == "Increasing the size of the output vector is not supported."); @@ -645,7 +664,7 @@ void test9() // on the other hand, downsizing is OK { std::vector<int> out(4); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select id from soci_test", into(out)); st.execute(); @@ -668,57 +687,57 @@ void test9() assert(out[0] == 8); assert(out[1] == 9); assert(out[2] == 10); - assert(st.fetch() == false); // end of data + bool gotData = st.fetch(); + assert(gotData == false); // end of data } std::cout << "test 9 passed" << std::endl; } -struct Person +struct person { int id; std::string firstName; - StringHolder lastName; //test mapping of TypeConversion-based types - std::string gender; + string_holder lastName; //test mapping of type_conversion-based types + std::string gender; }; // Object-Relational Mapping -// Note: Use the Values class as shown below in TypeConversions -// to achieve object relational mapping. The Values class should +// Note: Use the values class as shown below in type_conversions +// to achieve object relational mapping. The values class should // not be used directly in any other fashion. -namespace SOCI +namespace soci { // name-based conversion - template<> struct TypeConversion<Person> + template<> struct type_conversion<person> { - typedef Values base_type; + typedef values base_type; - static Person from(Values const &v) + static void from_base(values const &v, indicator /* ind */, person &p) { - Person p; + // ignoring possibility that the whole object might be NULL + p.id = v.get<int>("ID"); p.firstName = v.get<std::string>("FIRST_NAME"); - p.lastName = v.get<StringHolder>("LAST_NAME"); + p.lastName = v.get<string_holder>("LAST_NAME"); p.gender = v.get<std::string>("GENDER", "unknown"); - return p; } - static Values to(Person &p) + static void to_base(person const & p, values & v, indicator & ind) { - Values v; v.set("ID", p.id); v.set("FIRST_NAME", p.firstName); v.set("LAST_NAME", p.lastName); - v.set("GENDER", p.gender, p.gender.empty() ? eNull : eOK); - return v; + v.set("GENDER", p.gender, p.gender.empty() ? i_null : i_ok); + ind = i_ok; } }; } -struct PersonTableCreator : public TableCreatorBase +struct person_table_creator : public table_creator_base { - PersonTableCreator(Session& session) - : TableCreatorBase(session) + person_table_creator(session& session) + : table_creator_base(session) { session << "create table soci_test(id numeric(5,0) NOT NULL," << " last_name varchar2(20), first_name varchar2(20), " @@ -726,36 +745,36 @@ struct PersonTableCreator : public TableCreatorBase } }; -struct Times100ProcedureCreator : public ProcedureCreatorBase +struct times100_procedure_creator : public procedure_creator_base { - Times100ProcedureCreator(Session& session) - : ProcedureCreatorBase(session) + times100_procedure_creator(session& session) + : procedure_creator_base(session) { session << "create or replace procedure soci_test(id in out number)" - " as begin id := id * 100; end;"; + " as begin id := id * 100; end;"; } }; void test10() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); { - PersonTableCreator tableCreator(sql); + person_table_creator tableCreator(sql); - Person p; + person p; p.id = 1; p.lastName = "Smith"; p.firstName = "Pat"; sql << "insert into soci_test(id, first_name, last_name, gender) " << "values(:ID, :FIRST_NAME, :LAST_NAME, :GENDER)", use(p); - + // p should be unchanged assert(p.id == 1); assert(p.firstName == "Pat"); assert(p.lastName.get() == "Smith"); - Person p1; + person p1; sql << "select * from soci_test", into(p1); assert(p1.id == 1); assert(p1.firstName + p1.lastName.get() == "PatSmith"); @@ -770,45 +789,48 @@ void test10() assert(p.firstName == "Patricia"); assert(p.lastName.get() == "Smith"); // Note: gender is now "unknown" because of the mapping, not "" - assert(p.gender == "unknown"); + assert(p.gender == "unknown"); - Person p2; + person p2; sql << "select * from soci_test", into(p2); assert(p2.id == 1); assert(p2.firstName + p2.lastName.get() == "PatriciaSmith"); // insert a second row so we can test fetching - Person p3; + person p3; p3.id = 2; p3.firstName = "Joe"; p3.lastName = "Smith"; sql << "insert into soci_test(id, first_name, last_name, gender) " << "values(:ID, :FIRST_NAME, :LAST_NAME, :GENDER)", use(p3); - Person p4; - Statement st = (sql.prepare << "select * from soci_test order by id", + person p4; + statement st = (sql.prepare << "select * from soci_test order by id", into(p4)); st.execute(); - assert(st.fetch()); + bool gotData = st.fetch(); + assert(gotData); assert(p4.id == 1); assert(p4.firstName == "Patricia"); - assert(st.fetch()); + gotData = st.fetch(); + assert(gotData); assert(p4.id == 2); assert(p4.firstName == "Joe"); - assert(!st.fetch()); + gotData = st.fetch(); + assert(gotData == false); } // test with stored procedure { - Times100ProcedureCreator procedureCreator(sql); + times100_procedure_creator procedureCreator(sql); - Person p; + person p; p.id = 1; p.firstName = "Pat"; p.lastName = "Smith"; - Procedure proc = (sql.prepare << "soci_test(:ID)", use(p)); + procedure proc = (sql.prepare << "soci_test(:ID)", use(p)); proc.execute(1); assert(p.id == 100); assert(p.firstName == "Pat"); @@ -817,27 +839,26 @@ void test10() // test with stored procedure which returns null { - ReturnsNullProcedureCreator procedureCreator(sql); + returns_null_procedure_creator procedureCreator(sql); std::string msg; - Person p; + person p; try { - Procedure proc = (sql.prepare << "soci_test(:FIRST_NAME)", + procedure proc = (sql.prepare << "soci_test(:FIRST_NAME)", use(p)); proc.execute(1); } - catch (SOCIError& e) + catch (soci_error& e) { msg = e.what(); } - assert(msg == "Column FIRST_NAME contains NULL value and" - " no default was provided"); + assert(msg == "Null value not allowed for this type"); - Procedure proc = (sql.prepare << "soci_test(:GENDER)", + procedure proc = (sql.prepare << "soci_test(:GENDER)", use(p)); proc.execute(1); - assert(p.gender == "unknown"); + assert(p.gender == "unknown"); } std::cout << "test 10 passed" << std::endl; @@ -846,7 +867,7 @@ void test10() // Experimental support for position based O/R Mapping // additional type for position-based test -struct Person2 +struct person2 { int id; std::string firstName; @@ -855,38 +876,34 @@ struct Person2 }; // additional type for stream-like test -struct Person3 : Person2 {}; +struct person3 : person2 {}; -namespace SOCI +namespace soci { // position-based conversion - template<> struct TypeConversion<Person2> + template<> struct type_conversion<person2> { - typedef Values base_type; + typedef values base_type; - static Person2 from(Values const &v) + static void from_base(values const &v, indicator /* ind */, person2 &p) { - Person2 p; p.id = v.get<int>(0); p.firstName = v.get<std::string>(1); p.lastName = v.get<std::string>(2); p.gender = v.get<std::string>(3, "whoknows"); - return p; } // What about the "to" part? Does it make any sense to have it? }; // stream-like conversion - template<> struct TypeConversion<Person3> + template<> struct type_conversion<person3> { - typedef Values base_type; + typedef values base_type; - static Person3 from(Values const &v) + static void from_base(values const &v, indicator /* ind */, person3 &p) { - Person3 p; v >> p.id >> p.firstName >> p.lastName >> p.gender; - return p; } // TODO: The "to" part is certainly needed. }; @@ -894,11 +911,11 @@ namespace SOCI void test11() { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); - PersonTableCreator tableCreator(sql); + person_table_creator tableCreator(sql); - Person p; + person p; p.id = 1; p.lastName = "Smith"; p.firstName = "Patricia"; @@ -906,7 +923,7 @@ void test11() << "values(:ID, :FIRST_NAME, :LAST_NAME, :GENDER)", use(p); // test position-based conversion - Person2 p3; + person2 p3; sql << "select id, first_name, last_name, gender from soci_test", into(p3); assert(p3.id == 1); assert(p3.firstName + p3.lastName == "PatriciaSmith"); @@ -915,7 +932,7 @@ void test11() sql << "update soci_test set gender = 'F' where id = 1"; // additional test for stream-like conversion - Person3 p4; + person3 p4; sql << "select id, first_name, last_name, gender from soci_test", into(p4); assert(p4.id == 1); assert(p4.firstName + p4.lastName == "PatriciaSmith"); @@ -928,19 +945,19 @@ void test11() // Backwards compatibility - support use of large strings with // columns of type LONG /// -struct LongTableCreator : public TableCreatorBase +struct long_table_creator : public table_creator_base { - LongTableCreator(Session& session) - : TableCreatorBase(session) + long_table_creator(session& session) + : table_creator_base(session) { - session << "create table soci_test(l long)"; + session << "create table soci_test(l long)"; } }; void test12() { - Session sql(backEnd, connectString); - LongTableCreator creator(sql); + session sql(backEnd, connectString); + long_table_creator creator(sql); const std::string::size_type max = 32768; std::string in(max, 'X'); @@ -951,74 +968,160 @@ void test12() sql << "select l from soci_test", into(out); assert(out.size() == max); - assert(in == out); + assert(in == out); std::cout << "test 12 passed" << std::endl; } +// test for modifiable and const use elements +void test13() +{ + session sql(backEnd, connectString); + + int i = 7; + sql << "begin " + "select 2 * :i into :i from dual; " + "end;", use(i); + assert(i == 14); + + const int j = 7; + try + { + sql << "begin " + "select 2 * :i into :i from dual;" + " end;", use(j); + + assert(false); // should never get here + } + catch (soci_error const & e) + { + const std::string msg = e.what(); + assert(msg == "Attempted modification of const use element"); + } + + std::cout << "test 13 passed" << std::endl; +} + +struct longlong_table_creator : table_creator_base +{ + longlong_table_creator(session & sql) + : table_creator_base(sql) + { + sql << "create table soci_test(val number(20))"; + } +}; + +// long long test +void test14() +{ + { + session sql(backEnd, connectString); + + longlong_table_creator tableCreator(sql); + + long long v1 = 1000000000000LL; + assert(v1 / 1000000 == 1000000); + + sql << "insert into soci_test(val) values(:val)", use(v1); + + long long v2 = 0LL; + sql << "select val from soci_test", into(v2); + + assert(v2 == v1); + } + + // vector<long long> + { + session sql(backEnd, connectString); + + longlong_table_creator tableCreator(sql); + + std::vector<long long> v1; + v1.push_back(1000000000000LL); + v1.push_back(1000000000001LL); + v1.push_back(1000000000002LL); + v1.push_back(1000000000003LL); + v1.push_back(1000000000004LL); + + sql << "insert into soci_test(val) values(:val)", use(v1); + + std::vector<long long> v2(10); + sql << "select val from soci_test order by val desc", into(v2); + + assert(v2.size() == 5); + assert(v2[0] == 1000000000004LL); + assert(v2[1] == 1000000000003LL); + assert(v2[2] == 1000000000002LL); + assert(v2[3] == 1000000000001LL); + assert(v2[4] == 1000000000000LL); + } + + std::cout << "test 14 passed" << std::endl; +} + // -// Support for SOCI Common Tests +// Support for soci Common Tests // -struct TableCreator1 : public TableCreatorBase +struct table_creator_one : public table_creator_base { - TableCreator1(Session& session) - : TableCreatorBase(session) + table_creator_one(session& session) + : table_creator_base(session) { - session << "create table soci_test(id number, val number(4,0), c char, " + session << "create table soci_test(id number(10,0), val number(4,0), c char, " "str varchar2(20), sh number, ul number, d number, " "tm date, i1 number, i2 number, i3 number, name varchar2(20))"; } }; -struct TableCreator2 : public TableCreatorBase +struct table_creator_two : public table_creator_base { - TableCreator2(Session& session) - : TableCreatorBase(session) + table_creator_two(session& session) + : table_creator_base(session) { - session << "create table soci_test(\"num_float\" number, \"num_int\" numeric(4,0)," - " \"name\" varchar2(20), \"sometime\" date, \"chr\" char)"; + session << "create table soci_test(num_float number, num_int numeric(4,0)," + " name varchar2(20), sometime date, chr char)"; } }; -struct TableCreator3 : public TableCreatorBase +struct table_creator_three : public table_creator_base { - TableCreator3(Session& session) - : TableCreatorBase(session) + table_creator_three(session& session) + : table_creator_base(session) { - session << "create table soci_test(\"name\" varchar2(100) not null, " - "\"phone\" varchar2(15))"; + session << "create table soci_test(name varchar2(100) not null, " + "phone varchar2(15))"; } }; -class TestContext :public TestContextBase +class test_context :public test_context_base { public: - TestContext(BackEndFactory const &backEnd, + test_context(backend_factory const &backEnd, std::string const &connectString) - : TestContextBase(backEnd, connectString) {} - - TableCreatorBase* tableCreator1(Session& s) const + : test_context_base(backEnd, connectString) {} + + table_creator_base* table_creator_1(session& s) const { - return new TableCreator1(s); + return new table_creator_one(s); } - TableCreatorBase* tableCreator2(Session& s) const + table_creator_base* table_creator_2(session& s) const { - return new TableCreator2(s); + return new table_creator_two(s); } - TableCreatorBase* tableCreator3(Session& s) const + table_creator_base* table_creator_3(session& s) const { - return new TableCreator3(s); + return new table_creator_three(s); } - std::string toDateTime(std::string const &dateString) const + std::string to_date_time(std::string const &datdt_string) const { - return "to_date('" + dateString + "', 'YYYY-MM-DD HH24:MI:SS')"; + return "to_date('" + datdt_string + "', 'YYYY-MM-DD HH24:MI:SS')"; } }; - + int main(int argc, char** argv) { #ifdef _MSC_VER @@ -1040,17 +1143,16 @@ int main(int argc, char** argv) << " connectstring\n" << "example: " << argv[0] << " \'service=orcl user=scott password=tiger\'\n"; - exit(1); + std::exit(1); } try { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); + test_context tc(backEnd, connectString); + common_tests tests(tc); tests.run(); - std::cout << "\nSOCI Oracle tests:\n\n"; - + std::cout << "\nsoci Oracle tests:\n\n"; test1(); test2(); test3(); @@ -1060,10 +1162,12 @@ int main(int argc, char** argv) test7(); test8(); test9(); - test10(); + test10(); test11(); test12(); - + test13(); + test14(); + std::cout << "\nOK, all tests passed.\n\n"; } catch (std::exception const & e) diff --git a/src/backends/oracle/vector-into-type.cpp b/src/backends/oracle/vector-into-type.cpp index cfbe9cb2..b5affb0d 100644 --- a/src/backends/oracle/vector-into-type.cpp +++ b/src/backends/oracle/vector-into-type.cpp @@ -1,17 +1,18 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#define SOCI_ORACLE_SOURCE +#define soci_ORACLE_SOURCE #include "soci-oracle.h" +#include "statement.h" #include "error.h" -#include <soci.h> #include <cctype> #include <cstdio> #include <cstring> +#include <cstdlib> #include <ctime> #include <sstream> @@ -19,15 +20,15 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Oracle; +using namespace soci; +using namespace soci::details; +using namespace soci::details::oracle; -void OracleVectorIntoTypeBackEnd::prepareIndicators(std::size_t size) +void oracle_vector_into_type_backend::prepare_indicators(std::size_t size) { if (size == 0) { - throw SOCIError("Vectors of size 0 are not allowed."); + throw soci_error("Vectors of size 0 are not allowed."); } indOCIHolderVec_.resize(size); @@ -37,8 +38,8 @@ void OracleVectorIntoTypeBackEnd::prepareIndicators(std::size_t size) rCodes_.resize(size); } -void OracleVectorIntoTypeBackEnd::defineByPos( - int &position, void *data, eExchangeType type) +void oracle_vector_into_type_backend::define_by_pos( + int &position, void *data, exchange_type type) { data_ = data; // for future reference type_ = type; // for future reference @@ -49,82 +50,97 @@ void OracleVectorIntoTypeBackEnd::defineByPos( switch (type) { // simple cases - case eXChar: + case x_char: { oracleType = SQLT_AFC; size = sizeof(char); std::vector<char> *vp = static_cast<std::vector<char> *>(data); std::vector<char> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; - case eXShort: + case x_short: { oracleType = SQLT_INT; size = sizeof(short); std::vector<short> *vp = static_cast<std::vector<short> *>(data); std::vector<short> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; - case eXInteger: + case x_integer: { oracleType = SQLT_INT; size = sizeof(int); std::vector<int> *vp = static_cast<std::vector<int> *>(data); std::vector<int> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; - case eXUnsignedLong: + case x_unsigned_long: { oracleType = SQLT_UIN; size = sizeof(unsigned long); std::vector<unsigned long> *vp = static_cast<std::vector<unsigned long> *>(data); std::vector<unsigned long> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; - case eXDouble: + case x_double: { oracleType = SQLT_FLT; size = sizeof(double); std::vector<double> *vp = static_cast<std::vector<double> *>(data); std::vector<double> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; // cases that require adjustments and buffer management - case eXStdString: + case x_long_long: + { + oracleType = SQLT_STR; + std::vector<long long> *v + = static_cast<std::vector<long long> *>(data); + colSize_ = 100; // arbitrary buffer size for each entry + std::size_t const bufSize = colSize_ * v->size(); + buf_ = new char[bufSize]; + + prepare_indicators(v->size()); + + size = static_cast<sb4>(colSize_); + data = buf_; + } + break; + case x_stdstring: { oracleType = SQLT_CHR; std::vector<std::string> *v = static_cast<std::vector<std::string> *>(data); - colSize_ = statement_.columnSize(position) + 1; + colSize_ = statement_.column_size(position) + 1; std::size_t bufSize = colSize_ * v->size(); buf_ = new char[bufSize]; - prepareIndicators(v->size()); + prepare_indicators(v->size()); size = static_cast<sb4>(colSize_); data = buf_; } break; - case eXStdTm: + case x_stdtm: { oracleType = SQLT_DAT; std::vector<std::tm> *v = static_cast<std::vector<std::tm> *>(data); - prepareIndicators(v->size()); + prepare_indicators(v->size()); size = 7; // 7 is the size of SQLT_DAT std::size_t bufSize = size * v->size(); @@ -134,12 +150,12 @@ void OracleVectorIntoTypeBackEnd::defineByPos( } break; - case eXCString: break; // not supported + case x_cstring: break; // not supported // (there is no specialization // of IntoType<vector<char*> >) - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported + case x_statement: break; // not supported + case x_rowid: break; // not supported + case x_blob: break; // not supported } sword res = OCIDefineByPos(statement_.stmtp_, &defnp_, @@ -148,23 +164,23 @@ void OracleVectorIntoTypeBackEnd::defineByPos( indOCIHolders_, &sizes_[0], &rCodes_[0], OCI_DEFAULT); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, statement_.session_.errhp_); + throw_oracle_soci_error(res, statement_.session_.errhp_); } } -void OracleVectorIntoTypeBackEnd::preFetch() +void oracle_vector_into_type_backend::pre_fetch() { // nothing to do for the supported types } -void OracleVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) +void oracle_vector_into_type_backend::post_fetch(bool gotData, indicator *ind) { if (gotData) { // first, deal with data - // only std::string, std::tm and Statement need special handling - if (type_ == eXStdString) + // only std::string, std::tm, long long and Statement need special handling + if (type_ == x_stdstring) { std::vector<std::string> *vp = static_cast<std::vector<std::string> *>(data_); @@ -182,7 +198,25 @@ void OracleVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) pos += colSize_; } } - else if (type_ == eXStdTm) + else if (type_ == x_long_long) + { + std::vector<long long> *vp + = static_cast<std::vector<long long> *>(data_); + + std::vector<long long> &v(*vp); + + char *pos = buf_; + std::size_t const vsize = v.size(); + for (std::size_t i = 0; i != vsize; ++i) + { + if (indOCIHolderVec_[i] != -1) + { + v[i] = strtoll(pos, NULL, 10); + } + pos += colSize_; + } + } + else if (type_ == x_stdtm) { std::vector<std::tm> *vp = static_cast<std::vector<std::tm> *>(data_); @@ -216,29 +250,29 @@ void OracleVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) } } } - else if (type_ == eXStatement) + else if (type_ == x_statement) { - Statement *st = static_cast<Statement *>(data_); - st->defineAndBind(); + statement *st = static_cast<statement *>(data_); + st->define_and_bind(); } // then - deal with indicators if (ind != NULL) { - std::size_t const indSize = indOCIHolderVec_.size(); + std::size_t const indSize = statement_.get_number_of_rows(); for (std::size_t i = 0; i != indSize; ++i) { if (indOCIHolderVec_[i] == 0) { - ind[i] = eOK; + ind[i] = i_ok; } else if (indOCIHolderVec_[i] == -1) { - ind[i] = eNull; + ind[i] = i_null; } else { - ind[i] = eTruncated; + ind[i] = i_truncated; } } } @@ -250,7 +284,7 @@ void OracleVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) if (indOCIHolderVec_[i] == -1) { // fetched null and no indicator - programming error! - throw SOCIError( + throw soci_error( "Null value fetched and no indicator defined."); } } @@ -262,51 +296,58 @@ void OracleVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) } } -void OracleVectorIntoTypeBackEnd::resize(std::size_t sz) +void oracle_vector_into_type_backend::resize(std::size_t sz) { switch (type_) { // simple cases - case eXChar: + case x_char: { std::vector<char> *v = static_cast<std::vector<char> *>(data_); v->resize(sz); } break; - case eXShort: + case x_short: { std::vector<short> *v = static_cast<std::vector<short> *>(data_); v->resize(sz); } break; - case eXInteger: + case x_integer: { std::vector<int> *v = static_cast<std::vector<int> *>(data_); v->resize(sz); } break; - case eXUnsignedLong: + case x_unsigned_long: { std::vector<unsigned long> *v = static_cast<std::vector<unsigned long> *>(data_); v->resize(sz); } break; - case eXDouble: + case x_long_long: + { + std::vector<long long> *v + = static_cast<std::vector<long long> *>(data_); + v->resize(sz); + } + break; + case x_double: { std::vector<double> *v = static_cast<std::vector<double> *>(data_); v->resize(sz); } break; - case eXStdString: + case x_stdstring: { std::vector<std::string> *v = static_cast<std::vector<std::string> *>(data_); v->resize(sz); } break; - case eXStdTm: + case x_stdtm: { std::vector<std::tm> *v = static_cast<std::vector<std::tm> *>(data_); @@ -314,59 +355,66 @@ void OracleVectorIntoTypeBackEnd::resize(std::size_t sz) } break; - case eXCString: break; // not supported - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported + case x_cstring: break; // not supported + case x_statement: break; // not supported + case x_rowid: break; // not supported + case x_blob: break; // not supported } } -std::size_t OracleVectorIntoTypeBackEnd::size() +std::size_t oracle_vector_into_type_backend::size() { std::size_t sz = 0; // dummy initialization to please the compiler switch (type_) { // simple cases - case eXChar: + case x_char: { std::vector<char> *v = static_cast<std::vector<char> *>(data_); sz = v->size(); } break; - case eXShort: + case x_short: { std::vector<short> *v = static_cast<std::vector<short> *>(data_); sz = v->size(); } break; - case eXInteger: + case x_integer: { std::vector<int> *v = static_cast<std::vector<int> *>(data_); sz = v->size(); } break; - case eXUnsignedLong: + case x_unsigned_long: { std::vector<unsigned long> *v = static_cast<std::vector<unsigned long> *>(data_); sz = v->size(); } break; - case eXDouble: + case x_long_long: + { + std::vector<long long> *v + = static_cast<std::vector<long long> *>(data_); + sz = v->size(); + } + break; + case x_double: { std::vector<double> *v = static_cast<std::vector<double> *>(data_); sz = v->size(); } break; - case eXStdString: + case x_stdstring: { std::vector<std::string> *v = static_cast<std::vector<std::string> *>(data_); sz = v->size(); } break; - case eXStdTm: + case x_stdtm: { std::vector<std::tm> *v = static_cast<std::vector<std::tm> *>(data_); @@ -374,16 +422,16 @@ std::size_t OracleVectorIntoTypeBackEnd::size() } break; - case eXCString: break; // not supported - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported + case x_cstring: break; // not supported + case x_statement: break; // not supported + case x_rowid: break; // not supported + case x_blob: break; // not supported } return sz; } -void OracleVectorIntoTypeBackEnd::cleanUp() +void oracle_vector_into_type_backend::clean_up() { if (defnp_ != NULL) { diff --git a/src/backends/oracle/vector-use-type.cpp b/src/backends/oracle/vector-use-type.cpp index 4c029bc8..17e0a06c 100644 --- a/src/backends/oracle/vector-use-type.cpp +++ b/src/backends/oracle/vector-use-type.cpp @@ -1,14 +1,13 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#define SOCI_ORACLE_SOURCE +#define soci_ORACLE_SOURCE #include "soci-oracle.h" #include "error.h" -#include <soci.h> #include <cctype> #include <cstdio> #include <cstring> @@ -19,82 +18,100 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Oracle; +using namespace soci; +using namespace soci::details; +using namespace soci::details::oracle; -void OracleVectorUseTypeBackEnd::prepareIndicators(std::size_t size) +void oracle_vector_use_type_backend::prepare_indicators(std::size_t size) { if (size == 0) { - throw SOCIError("Vectors of size 0 are not allowed."); + throw soci_error("Vectors of size 0 are not allowed."); } indOCIHolderVec_.resize(size); indOCIHolders_ = &indOCIHolderVec_[0]; } -void OracleVectorUseTypeBackEnd::prepareForBind( +void oracle_vector_use_type_backend::prepare_for_bind( void *&data, sb4 &size, ub2 &oracleType) { switch (type_) { // simple cases - case eXChar: + case x_char: { oracleType = SQLT_AFC; size = sizeof(char); std::vector<char> *vp = static_cast<std::vector<char> *>(data); std::vector<char> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; - case eXShort: + case x_short: { oracleType = SQLT_INT; size = sizeof(short); std::vector<short> *vp = static_cast<std::vector<short> *>(data); std::vector<short> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; - case eXInteger: + case x_integer: { oracleType = SQLT_INT; size = sizeof(int); std::vector<int> *vp = static_cast<std::vector<int> *>(data); std::vector<int> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; - case eXUnsignedLong: + case x_unsigned_long: { oracleType = SQLT_UIN; size = sizeof(unsigned long); std::vector<unsigned long> *vp = static_cast<std::vector<unsigned long> *>(data); std::vector<unsigned long> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; - case eXDouble: + case x_double: { oracleType = SQLT_FLT; size = sizeof(double); std::vector<double> *vp = static_cast<std::vector<double> *>(data); std::vector<double> &v(*vp); - prepareIndicators(v.size()); + prepare_indicators(v.size()); data = &v[0]; } break; // cases that require adjustments and buffer management - case eXStdString: + case x_long_long: + { + std::vector<long long> *vp + = static_cast<std::vector<long long> *>(data); + std::vector<long long> &v(*vp); + + std::size_t const vecSize = v.size(); + std::size_t const entrySize = 100; // arbitrary + std::size_t const bufSize = entrySize * vecSize; + buf_ = new char[bufSize]; + + oracleType = SQLT_STR; + data = buf_; + size = entrySize; + + prepare_indicators(vecSize); + } + break; + case x_stdstring: { std::vector<std::string> *vp = static_cast<std::vector<std::string> *>(data); @@ -102,7 +119,7 @@ void OracleVectorUseTypeBackEnd::prepareForBind( std::size_t maxSize = 0; std::size_t const vecSize = v.size(); - prepareIndicators(vecSize); + prepare_indicators(vecSize); for (std::size_t i = 0; i != vecSize; ++i) { std::size_t sz = v[i].length(); @@ -123,12 +140,12 @@ void OracleVectorUseTypeBackEnd::prepareForBind( size = static_cast<sb4>(maxSize); } break; - case eXStdTm: + case x_stdtm: { std::vector<std::tm> *vp = static_cast<std::vector<std::tm> *>(data); - prepareIndicators(vp->size()); + prepare_indicators(vp->size()); sb4 const dlen = 7; // size of SQLT_DAT buf_ = new char[dlen * vp->size()]; @@ -139,15 +156,15 @@ void OracleVectorUseTypeBackEnd::prepareForBind( } break; - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported - case eXCString: break; // not supported + case x_statement: break; // not supported + case x_rowid: break; // not supported + case x_blob: break; // not supported + case x_cstring: break; // not supported } } -void OracleVectorUseTypeBackEnd::bindByPos(int &position, - void *data, eExchangeType type) +void oracle_vector_use_type_backend::bind_by_pos(int &position, + void *data, exchange_type type) { data_ = data; // for future reference type_ = type; // for future reference @@ -155,10 +172,10 @@ void OracleVectorUseTypeBackEnd::bindByPos(int &position, ub2 oracleType; sb4 size; - prepareForBind(data, size, oracleType); + prepare_for_bind(data, size, oracleType); ub2 *sizesP = 0; // used only for std::string - if (type == eXStdString) + if (type == x_stdstring) { sizesP = &sizes_[0]; } @@ -169,12 +186,12 @@ void OracleVectorUseTypeBackEnd::bindByPos(int &position, indOCIHolders_, sizesP, 0, 0, 0, OCI_DEFAULT); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, statement_.session_.errhp_); + throw_oracle_soci_error(res, statement_.session_.errhp_); } } -void OracleVectorUseTypeBackEnd::bindByName( - std::string const &name, void *data, eExchangeType type) +void oracle_vector_use_type_backend::bind_by_name( + std::string const &name, void *data, exchange_type type) { data_ = data; // for future reference type_ = type; // for future reference @@ -182,10 +199,10 @@ void OracleVectorUseTypeBackEnd::bindByName( ub2 oracleType; sb4 size; - prepareForBind(data, size, oracleType); + prepare_for_bind(data, size, oracleType); ub2 *sizesP = 0; // used only for std::string - if (type == eXStdString) + if (type == x_stdstring) { sizesP = &sizes_[0]; } @@ -198,20 +215,35 @@ void OracleVectorUseTypeBackEnd::bindByName( indOCIHolders_, sizesP, 0, 0, 0, OCI_DEFAULT); if (res != OCI_SUCCESS) { - throwOracleSOCIError(res, statement_.session_.errhp_); + throw_oracle_soci_error(res, statement_.session_.errhp_); } } -void OracleVectorUseTypeBackEnd::preUse(eIndicator const *ind) +void oracle_vector_use_type_backend::pre_use(indicator const *ind) { // first deal with data - if (type_ == eXStdString) + if (type_ == x_stdstring) { // nothing to do - it's already done during bind // (and it's probably impossible to separate them, because // changes in the string size could not be handled here) } - else if (type_ == eXStdTm) + else if (type_ == x_long_long) + { + std::vector<long long> *vp + = static_cast<std::vector<long long> *>(data_); + std::vector<long long> &v(*vp); + + char *pos = buf_; + std::size_t const entrySize = 100; // arbitrary, but consistent + std::size_t const vecSize = v.size(); + for (std::size_t i = 0; i != vecSize; ++i) + { + snprintf(pos, entrySize, "%lld", v[i]); + pos += entrySize; + } + } + else if (type_ == x_stdtm) { std::vector<std::tm> *vp = static_cast<std::vector<std::tm> *>(data_); @@ -237,7 +269,7 @@ void OracleVectorUseTypeBackEnd::preUse(eIndicator const *ind) std::size_t const vsize = size(); for (std::size_t i = 0; i != vsize; ++i, ++ind) { - if (*ind == eNull) + if (*ind == i_null) { indOCIHolderVec_[i] = -1; // null } @@ -258,52 +290,59 @@ void OracleVectorUseTypeBackEnd::preUse(eIndicator const *ind) } } -std::size_t OracleVectorUseTypeBackEnd::size() +std::size_t oracle_vector_use_type_backend::size() { std::size_t sz = 0; // dummy initialization to please the compiler switch (type_) { // simple cases - case eXChar: + case x_char: { std::vector<char> *vp = static_cast<std::vector<char> *>(data_); sz = vp->size(); } break; - case eXShort: + case x_short: { std::vector<short> *vp = static_cast<std::vector<short> *>(data_); sz = vp->size(); } break; - case eXInteger: + case x_integer: { std::vector<int> *vp = static_cast<std::vector<int> *>(data_); sz = vp->size(); } break; - case eXUnsignedLong: + case x_unsigned_long: { std::vector<unsigned long> *vp = static_cast<std::vector<unsigned long> *>(data_); sz = vp->size(); } break; - case eXDouble: + case x_long_long: + { + std::vector<long long> *vp + = static_cast<std::vector<long long> *>(data_); + sz = vp->size(); + } + break; + case x_double: { std::vector<double> *vp = static_cast<std::vector<double> *>(data_); sz = vp->size(); } break; - case eXStdString: + case x_stdstring: { std::vector<std::string> *vp = static_cast<std::vector<std::string> *>(data_); sz = vp->size(); } break; - case eXStdTm: + case x_stdtm: { std::vector<std::tm> *vp = static_cast<std::vector<std::tm> *>(data_); @@ -311,16 +350,16 @@ std::size_t OracleVectorUseTypeBackEnd::size() } break; - case eXStatement: break; // not supported - case eXRowID: break; // not supported - case eXBLOB: break; // not supported - case eXCString: break; // not supported + case x_statement: break; // not supported + case x_rowid: break; // not supported + case x_blob: break; // not supported + case x_cstring: break; // not supported } return sz; } -void OracleVectorUseTypeBackEnd::cleanUp() +void oracle_vector_use_type_backend::clean_up() { if (buf_ != NULL) { diff --git a/src/backends/postgresql/Makefile.am b/src/backends/postgresql/Makefile.am deleted file mode 100644 index 1513e178..00000000 --- a/src/backends/postgresql/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:32 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @POSTGRESQL_CFLAGS@ -AM_LDFLAGS = @POSTGRESQL_LDFLAGS@ - -lib_LTLIBRARIES = \ - lib@SOCI_POSTGRESQL_LIBRARY_NAME@.la - -lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - common.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_postgresqldir = $(includedir)/soci/postgresql - -soci_postgresql_HEADERS = \ - common.h \ - soci-postgresql.h - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/postgresql/Makefile.basic b/src/backends/postgresql/Makefile.basic index 137e6b69..429d4399 100644 --- a/src/backends/postgresql/Makefile.basic +++ b/src/backends/postgresql/Makefile.basic @@ -20,7 +20,7 @@ OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ vector-into-type-s.o vector-use-type-s.o common-s.o -libsoci-postgresql.a : ${OBJECTS} +libsoci_postgresql.a : ${OBJECTS} ar rv $@ $? rm *.o @@ -57,7 +57,7 @@ vector-use-type.o : vector-use-type.cpp shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci-postgresql.so ${OBJECTSSO} + ${COMPILER} -shared -o libsoci_postgresql.so ${OBJECTSSO} rm *.o blob-s.o : blob.cpp @@ -92,4 +92,4 @@ vector-use-type-s.o : vector-use-type.cpp clean : - rm -f libsoci-postgresql.a libsoci-postgresql.so + rm -f libsoci_postgresql.a libsoci_postgresql.so diff --git a/src/backends/postgresql/Makefile.in b/src/backends/postgresql/Makefile.in deleted file mode 100644 index 29977cab..00000000 --- a/src/backends/postgresql/Makefile.in +++ /dev/null @@ -1,563 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends/postgresql -DIST_COMMON = $(soci_postgresql_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" \ - "$(DESTDIR)$(soci_postgresqldir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_LIBADD = -am_lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_OBJECTS = blob.lo common.lo \ - factory.lo row-id.lo session.lo standard-into-type.lo \ - standard-use-type.lo statement.lo vector-into-type.lo \ - vector-use-type.lo -lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_OBJECTS = \ - $(am_lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_SOURCES) -DIST_SOURCES = $(lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_SOURCES) -soci_postgresqlHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(soci_postgresql_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:32 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @POSTGRESQL_CFLAGS@ -AM_LDFLAGS = @POSTGRESQL_LDFLAGS@ -lib_LTLIBRARIES = \ - lib@SOCI_POSTGRESQL_LIBRARY_NAME@.la - -lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - common.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_postgresqldir = $(includedir)/soci/postgresql -soci_postgresql_HEADERS = \ - common.h \ - soci-postgresql.h - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/postgresql/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/postgresql/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -lib@SOCI_POSTGRESQL_LIBRARY_NAME@.la: $(lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_LDFLAGS) $(lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_POSTGRESQL_LIBRARY_NAME@_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blob.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/row-id.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-use-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-use-type.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-soci_postgresqlHEADERS: $(soci_postgresql_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(soci_postgresqldir)" || $(mkdir_p) "$(DESTDIR)$(soci_postgresqldir)" - @list='$(soci_postgresql_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(soci_postgresqlHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(soci_postgresqldir)/$$f'"; \ - $(soci_postgresqlHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(soci_postgresqldir)/$$f"; \ - done - -uninstall-soci_postgresqlHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(soci_postgresql_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(soci_postgresqldir)/$$f'"; \ - rm -f "$(DESTDIR)$(soci_postgresqldir)/$$f"; \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soci_postgresqldir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-soci_postgresqlHEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-soci_postgresqlHEADERS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLTLIBRARIES install-man \ - install-soci_postgresqlHEADERS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic maintainer-clean-local mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-soci_postgresqlHEADERS - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/postgresql/blob.cpp b/src/backends/postgresql/blob.cpp index c71d81ad..997033d0 100644 --- a/src/backends/postgresql/blob.cpp +++ b/src/backends/postgresql/blob.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,7 +7,6 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" -#include <soci.h> #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> @@ -23,93 +22,93 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; -PostgreSQLBLOBBackEnd::PostgreSQLBLOBBackEnd( - PostgreSQLSessionBackEnd &session) +postgresql_blob_backend::postgresql_blob_backend( + postgresql_session_backend & session) : session_(session), fd_(-1) { // nothing to do here, the descriptor is open in the postFetch // method of the Into element } -PostgreSQLBLOBBackEnd::~PostgreSQLBLOBBackEnd() +postgresql_blob_backend::~postgresql_blob_backend() { lo_close(session_.conn_, fd_); } -std::size_t PostgreSQLBLOBBackEnd::getLen() +std::size_t postgresql_blob_backend::get_len() { - int pos = lo_lseek(session_.conn_, fd_, 0, SEEK_END); + int const pos = lo_lseek(session_.conn_, fd_, 0, SEEK_END); if (pos == -1) { - throw SOCIError("Cannot retrieve the size of BLOB."); + throw soci_error("Cannot retrieve the size of BLOB."); } return static_cast<std::size_t>(pos); } -std::size_t PostgreSQLBLOBBackEnd::read( - std::size_t offset, char *buf, std::size_t toRead) +std::size_t postgresql_blob_backend::read( + std::size_t offset, char * buf, std::size_t toRead) { - int pos = lo_lseek(session_.conn_, fd_, + int const pos = lo_lseek(session_.conn_, fd_, static_cast<int>(offset), SEEK_SET); if (pos == -1) { - throw SOCIError("Cannot seek in BLOB."); + throw soci_error("Cannot seek in BLOB."); } - int readn = lo_read(session_.conn_, fd_, buf, toRead); + int const readn = lo_read(session_.conn_, fd_, buf, toRead); if (readn < 0) { - throw SOCIError("Cannot read from BLOB."); + throw soci_error("Cannot read from BLOB."); } return static_cast<std::size_t>(readn); } -std::size_t PostgreSQLBLOBBackEnd::write( - std::size_t offset, char const *buf, std::size_t toWrite) +std::size_t postgresql_blob_backend::write( + std::size_t offset, char const * buf, std::size_t toWrite) { - int pos = lo_lseek(session_.conn_, fd_, + int const pos = lo_lseek(session_.conn_, fd_, static_cast<int>(offset), SEEK_SET); if (pos == -1) { - throw SOCIError("Cannot seek in BLOB."); + throw soci_error("Cannot seek in BLOB."); } - int writen = lo_write(session_.conn_, fd_, + int const writen = lo_write(session_.conn_, fd_, const_cast<char *>(buf), toWrite); if (writen < 0) { - throw SOCIError("Cannot write to BLOB."); + throw soci_error("Cannot write to BLOB."); } return static_cast<std::size_t>(writen); } -std::size_t PostgreSQLBLOBBackEnd::append( - char const *buf, std::size_t toWrite) +std::size_t postgresql_blob_backend::append( + char const * buf, std::size_t toWrite) { - int pos = lo_lseek(session_.conn_, fd_, 0, SEEK_END); + int const pos = lo_lseek(session_.conn_, fd_, 0, SEEK_END); if (pos == -1) { - throw SOCIError("Cannot seek in BLOB."); + throw soci_error("Cannot seek in BLOB."); } - int writen = lo_write(session_.conn_, fd_, + int const writen = lo_write(session_.conn_, fd_, const_cast<char *>(buf), toWrite); if (writen < 0) { - throw SOCIError("Cannot append to BLOB."); + throw soci_error("Cannot append to BLOB."); } return static_cast<std::size_t>(writen); } -void PostgreSQLBLOBBackEnd::trim(std::size_t /* newLen */) +void postgresql_blob_backend::trim(std::size_t /* newLen */) { - throw SOCIError("Trimming BLOBs is not supported."); + throw soci_error("Trimming BLOBs is not supported."); } diff --git a/src/backends/postgresql/common.cpp b/src/backends/postgresql/common.cpp index 5c49c3af..c243fffc 100644 --- a/src/backends/postgresql/common.cpp +++ b/src/backends/postgresql/common.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -15,7 +15,7 @@ namespace // anonymous { // helper function for parsing decimal data (for std::tm) -long parse10(char const *&p1, char *&p2, char *msg) +long parse10(char const * & p1, char * & p2, char const * msg) { long v = std::strtol(p1, &p2, 10); if (p2 != p1) @@ -25,21 +25,21 @@ long parse10(char const *&p1, char *&p2, char *msg) } else { - throw SOCI::SOCIError(msg); + throw soci::soci_error(msg); } } } // namespace anonymous -void SOCI::details::PostgreSQL::parseStdTm(char const *buf, std::tm &t) +void soci::details::postgresql::parse_std_tm(char const * buf, std::tm & t) { - char const *p1 = buf; - char *p2; + char const * p1 = buf; + char * p2; long year, month, day; long hour = 0, minute = 0, second = 0; - char *errMsg = "Cannot convert data to std::tm."; + char const * errMsg = "Cannot convert data to std::tm."; year = parse10(p1, p2, errMsg); month = parse10(p1, p2, errMsg); @@ -63,3 +63,21 @@ void SOCI::details::PostgreSQL::parseStdTm(char const *buf, std::tm &t) std::mktime(&t); } + +double soci::details::postgresql::string_to_double(char const * buf) +{ + double t; + int n; + int const converted = sscanf(buf, "%lf%n", &t, &n); + if (converted == 1 && static_cast<std::size_t>(n) == strlen(buf)) + { + // successfully converted to double + // and no other characters were found in the buffer + + return t; + } + else + { + throw soci_error("Cannot convert data."); + } +} diff --git a/src/backends/postgresql/common.h b/src/backends/postgresql/common.h index 0908391e..1e1827b2 100644 --- a/src/backends/postgresql/common.h +++ b/src/backends/postgresql/common.h @@ -1,37 +1,90 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef POSTGRESQL_COMMON_H_INCLUDED -#define POSTGRESQL_COMMON_H_INCLUDED +#ifndef SOCI_POSTGRESQL_COMMON_H_INCLUDED +#define SOCI_POSTGRESQL_COMMON_H_INCLUDED #include "soci-postgresql.h" +#include <limits> +#include <cstring> +#include <ctime> -namespace SOCI { +namespace soci +{ + +namespace details +{ -namespace details { +namespace postgresql +{ -namespace PostgreSQL { +// helper function for parsing integers +template <typename T> +T string_to_integer(char const * buf) +{ + long long t; + int n; + int const converted = sscanf(buf, "%lld%n", &t, &n); + if (converted == 1 && static_cast<std::size_t>(n) == strlen(buf)) + { + // successfully converted to long long + // and no other characters were found in the buffer + + const T max = (std::numeric_limits<T>::max)(); + const T min = (std::numeric_limits<T>::min)(); + if (t <= static_cast<long long>(max) && + t >= static_cast<long long>(min)) + { + return static_cast<T>(t); + } + else + { + // value of out target range + throw soci_error("Cannot convert data."); + } + } + else + { + // try additional conversion from boolean + // (PostgreSQL gives 't' or 'f' for boolean results) + + if (buf[0] == 't' && buf[1] == '\0') + { + return static_cast<T>(1); + } + else if (buf[0] == 'f' && buf[1] == '\0') + { + return static_cast<T>(0); + } + else + { + throw soci_error("Cannot convert data."); + } + } +} + +// helper function for parsing doubles +double string_to_double(char const * buf); // helper function for parsing datetime values -void parseStdTm(char const *buf, std::tm &t); +void parse_std_tm(char const * buf, std::tm & t); // helper for vector operations template <typename T> -std::size_t getVectorSize(void *p) +std::size_t get_vector_size(void * p) { - std::vector<T> *v = static_cast<std::vector<T> *>(p); + std::vector<T> * v = static_cast<std::vector<T> *>(p); return v->size(); } -} // namespace PostgreSQL +} // namespace postgresql } // namespace details -} // namespace SOCI - -#endif // POSTGRESQL_COMMON_H_INCLUDED +} // namespace soci +#endif // SOCI_POSTGRESQL_COMMON_H_INCLUDED diff --git a/src/backends/postgresql/factory.cpp b/src/backends/postgresql/factory.cpp index 9753c6a8..e4a7253c 100644 --- a/src/backends/postgresql/factory.cpp +++ b/src/backends/postgresql/factory.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,7 +7,6 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" -#include <soci.h> #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> @@ -23,15 +22,26 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; // concrete factory for Empty concrete strategies -PostgreSQLSessionBackEnd * PostgreSQLBackEndFactory::makeSession( - std::string const &connectString) const +postgresql_session_backend * postgresql_backend_factory::make_session( + std::string const & connectString) const { - return new PostgreSQLSessionBackEnd(connectString); + return new postgresql_session_backend(connectString); } -PostgreSQLBackEndFactory const SOCI::postgresql; +postgresql_backend_factory const soci::postgresql; + +extern "C" +{ + +// for dynamic backend loading +SOCI_POSTGRESQL_DECL backend_factory const * factory_postgresql() +{ + return &soci::postgresql; +} + +} // extern "C" diff --git a/src/backends/postgresql/row-id.cpp b/src/backends/postgresql/row-id.cpp index b1a26085..05521796 100644 --- a/src/backends/postgresql/row-id.cpp +++ b/src/backends/postgresql/row-id.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,7 +7,6 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" -#include <soci.h> #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> @@ -23,17 +22,17 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; -PostgreSQLRowIDBackEnd::PostgreSQLRowIDBackEnd( - PostgreSQLSessionBackEnd & /* session */) +postgresql_rowid_backend::postgresql_rowid_backend( + postgresql_session_backend & /* session */) { // nothing to do here } -PostgreSQLRowIDBackEnd::~PostgreSQLRowIDBackEnd() +postgresql_rowid_backend::~postgresql_rowid_backend() { // nothing to do here } diff --git a/src/backends/postgresql/session.cpp b/src/backends/postgresql/session.cpp index 00595a7b..4edf7e10 100644 --- a/src/backends/postgresql/session.cpp +++ b/src/backends/postgresql/session.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,7 +7,6 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" -#include <soci.h> #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> @@ -23,66 +22,76 @@ #pragma warning(disable:4355 4996) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; -PostgreSQLSessionBackEnd::PostgreSQLSessionBackEnd( +postgresql_session_backend::postgresql_session_backend( std::string const & connectString) : statementCount_(0) { - conn_ = PQconnectdb(connectString.c_str()); - if (conn_ == NULL || PQstatus(conn_) != CONNECTION_OK) + PGconn * conn = PQconnectdb(connectString.c_str()); + if (conn == NULL || PQstatus(conn) != CONNECTION_OK) { - throw SOCIError("Cannot establish connection to the database."); + std::string msg = "Cannot establish connection to the database."; + if (conn != NULL) + { + msg += '\n'; + msg += PQerrorMessage(conn); + PQfinish(conn); + } + + throw soci_error(msg); } + + conn_ = conn; } -PostgreSQLSessionBackEnd::~PostgreSQLSessionBackEnd() +postgresql_session_backend::~postgresql_session_backend() { - cleanUp(); + clean_up(); } -namespace // anonymous +namespace // unnamed { // helper function for hardoded queries -void hardExec(PGconn *conn, char const *query, char const *errMsg) +void hard_exec(PGconn * conn, char const * query, char const * errMsg) { - PGresult *result = PQexec(conn, query); + PGresult * result = PQexec(conn, query); if (result == NULL) { - throw SOCIError(errMsg); + throw soci_error(errMsg); } - ExecStatusType status = PQresultStatus(result); + ExecStatusType const status = PQresultStatus(result); if (status != PGRES_COMMAND_OK) { - throw SOCIError(PQresultErrorMessage(result)); + throw soci_error(PQresultErrorMessage(result)); } PQclear(result); } -} // namespace anonymous +} // namespace unnamed -void PostgreSQLSessionBackEnd::begin() +void postgresql_session_backend::begin() { - hardExec(conn_, "BEGIN", "Cannot begin transaction."); + hard_exec(conn_, "BEGIN", "Cannot begin transaction."); } -void PostgreSQLSessionBackEnd::commit() +void postgresql_session_backend::commit() { - hardExec(conn_, "COMMIT", "Cannot commit transaction."); + hard_exec(conn_, "COMMIT", "Cannot commit transaction."); } -void PostgreSQLSessionBackEnd::rollback() +void postgresql_session_backend::rollback() { - hardExec(conn_, "ROLLBACK", "Cannot rollback transaction."); + hard_exec(conn_, "ROLLBACK", "Cannot rollback transaction."); } -void PostgreSQLSessionBackEnd::cleanUp() +void postgresql_session_backend::clean_up() { if (conn_ != NULL) { @@ -91,24 +100,24 @@ void PostgreSQLSessionBackEnd::cleanUp() } } -std::string PostgreSQLSessionBackEnd::getNextStatementName() +std::string postgresql_session_backend::get_next_statement_name() { char nameBuf[20]; // arbitrary length sprintf(nameBuf, "st_%d", ++statementCount_); return nameBuf; } -PostgreSQLStatementBackEnd * PostgreSQLSessionBackEnd::makeStatementBackEnd() +postgresql_statement_backend * postgresql_session_backend::make_statement_backend() { - return new PostgreSQLStatementBackEnd(*this); + return new postgresql_statement_backend(*this); } -PostgreSQLRowIDBackEnd * PostgreSQLSessionBackEnd::makeRowIDBackEnd() +postgresql_rowid_backend * postgresql_session_backend::make_rowid_backend() { - return new PostgreSQLRowIDBackEnd(*this); + return new postgresql_rowid_backend(*this); } -PostgreSQLBLOBBackEnd * PostgreSQLSessionBackEnd::makeBLOBBackEnd() +postgresql_blob_backend * postgresql_session_backend::make_blob_backend() { - return new PostgreSQLBLOBBackEnd(*this); + return new postgresql_blob_backend(*this); } diff --git a/src/backends/postgresql/soci-postgresql.h b/src/backends/postgresql/soci-postgresql.h index 350c3356..5c35991b 100644 --- a/src/backends/postgresql/soci-postgresql.h +++ b/src/backends/postgresql/soci-postgresql.h @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -32,134 +32,134 @@ #endif -namespace SOCI +namespace soci { -struct PostgreSQLStatementBackEnd; -struct PostgreSQLStandardIntoTypeBackEnd : details::StandardIntoTypeBackEnd +struct postgresql_statement_backend; +struct postgresql_standard_into_type_backend : details::standard_into_type_backend { - PostgreSQLStandardIntoTypeBackEnd(PostgreSQLStatementBackEnd &st) + postgresql_standard_into_type_backend(postgresql_statement_backend & st) : statement_(st) {} - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); + virtual void define_by_pos(int & position, + void * data, details::exchange_type type); - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind); + virtual void pre_fetch(); + virtual void post_fetch(bool gotData, bool calledFromFetch, + indicator * ind); - virtual void cleanUp(); + virtual void clean_up(); - PostgreSQLStatementBackEnd &statement_; + postgresql_statement_backend & statement_; - void *data_; - details::eExchangeType type_; + void * data_; + details::exchange_type type_; int position_; }; -struct PostgreSQLVectorIntoTypeBackEnd : details::VectorIntoTypeBackEnd +struct postgresql_vector_into_type_backend : details::vector_into_type_backend { - PostgreSQLVectorIntoTypeBackEnd(PostgreSQLStatementBackEnd &st) + postgresql_vector_into_type_backend(postgresql_statement_backend & st) : statement_(st) {} - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); + virtual void define_by_pos(int & position, + void * data, details::exchange_type type); - virtual void preFetch(); - virtual void postFetch(bool gotData, eIndicator *ind); + virtual void pre_fetch(); + virtual void post_fetch(bool gotData, indicator * ind); virtual void resize(std::size_t sz); virtual std::size_t size(); - virtual void cleanUp(); + virtual void clean_up(); - PostgreSQLStatementBackEnd &statement_; + postgresql_statement_backend & statement_; - void *data_; - details::eExchangeType type_; + void * data_; + details::exchange_type type_; int position_; }; -struct PostgreSQLStandardUseTypeBackEnd : details::StandardUseTypeBackEnd +struct postgresql_standard_use_type_backend : details::standard_use_type_backend { - PostgreSQLStandardUseTypeBackEnd(PostgreSQLStatementBackEnd &st) + postgresql_standard_use_type_backend(postgresql_statement_backend & st) : statement_(st), position_(0), buf_(NULL) {} - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); + virtual void bind_by_pos(int & position, + void * data, details::exchange_type type, bool readOnly); + virtual void bind_by_name(std::string const & name, + void * data, details::exchange_type type, bool readOnly); - virtual void preUse(eIndicator const *ind); - virtual void postUse(bool gotData, eIndicator *ind); + virtual void pre_use(indicator const * ind); + virtual void post_use(bool gotData, indicator * ind); - virtual void cleanUp(); + virtual void clean_up(); - PostgreSQLStatementBackEnd &statement_; + postgresql_statement_backend & statement_; - void *data_; - details::eExchangeType type_; + void * data_; + details::exchange_type type_; int position_; std::string name_; - char *buf_; + char * buf_; }; -struct PostgreSQLVectorUseTypeBackEnd : details::VectorUseTypeBackEnd +struct postgresql_vector_use_type_backend : details::vector_use_type_backend { - PostgreSQLVectorUseTypeBackEnd(PostgreSQLStatementBackEnd &st) + postgresql_vector_use_type_backend(postgresql_statement_backend & st) : statement_(st), position_(0) {} - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); + virtual void bind_by_pos(int & position, + void * data, details::exchange_type type); + virtual void bind_by_name(std::string const & name, + void * data, details::exchange_type type); - virtual void preUse(eIndicator const *ind); + virtual void pre_use(indicator const * ind); virtual std::size_t size(); - virtual void cleanUp(); + virtual void clean_up(); - PostgreSQLStatementBackEnd &statement_; + postgresql_statement_backend & statement_; - void *data_; - details::eExchangeType type_; + void * data_; + details::exchange_type type_; int position_; std::string name_; std::vector<char *> buffers_; }; -struct PostgreSQLSessionBackEnd; -struct PostgreSQLStatementBackEnd : details::StatementBackEnd +struct postgresql_session_backend; +struct postgresql_statement_backend : details::statement_backend { - PostgreSQLStatementBackEnd(PostgreSQLSessionBackEnd &session); + postgresql_statement_backend(postgresql_session_backend & session); virtual void alloc(); - virtual void cleanUp(); - virtual void prepare(std::string const &query, - details::eStatementType eType); + virtual void clean_up(); + virtual void prepare(std::string const & query, + details::statement_type stType); - virtual execFetchResult execute(int number); - virtual execFetchResult fetch(int number); + virtual exec_fetch_result execute(int number); + virtual exec_fetch_result fetch(int number); - virtual int getNumberOfRows(); + virtual int get_number_of_rows(); - virtual std::string rewriteForProcedureCall(std::string const &query); + virtual std::string rewrite_for_procedure_call(std::string const & query); - virtual int prepareForDescribe(); - virtual void describeColumn(int colNum, eDataType &dtype, - std::string &columnName); + virtual int prepare_for_describe(); + virtual void describe_column(int colNum, data_type & dtype, + std::string & columnName); - virtual PostgreSQLStandardIntoTypeBackEnd * makeIntoTypeBackEnd(); - virtual PostgreSQLStandardUseTypeBackEnd * makeUseTypeBackEnd(); - virtual PostgreSQLVectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd(); - virtual PostgreSQLVectorUseTypeBackEnd * makeVectorUseTypeBackEnd(); + virtual postgresql_standard_into_type_backend * make_into_type_backend(); + virtual postgresql_standard_use_type_backend * make_use_type_backend(); + virtual postgresql_vector_into_type_backend * make_vector_into_type_backend(); + virtual postgresql_vector_use_type_backend * make_vector_use_type_backend(); - PostgreSQLSessionBackEnd &session_; + postgresql_session_backend & session_; - PGresult *result_; + PGresult * result_; std::string query_; - details::eStatementType eType_; + details::statement_type stType_; std::string statementName_; std::vector<std::string> names_; // list of names for named binds @@ -185,67 +185,76 @@ struct PostgreSQLStatementBackEnd : details::StatementBackEnd UseByNameBuffersMap useByNameBuffers_; }; -struct PostgreSQLRowIDBackEnd : details::RowIDBackEnd +struct postgresql_rowid_backend : details::rowid_backend { - PostgreSQLRowIDBackEnd(PostgreSQLSessionBackEnd &session); + postgresql_rowid_backend(postgresql_session_backend & session); - ~PostgreSQLRowIDBackEnd(); + ~postgresql_rowid_backend(); unsigned long value_; }; -struct PostgreSQLBLOBBackEnd : details::BLOBBackEnd +struct postgresql_blob_backend : details::blob_backend { - PostgreSQLBLOBBackEnd(PostgreSQLSessionBackEnd &session); + postgresql_blob_backend(postgresql_session_backend & session); - ~PostgreSQLBLOBBackEnd(); + ~postgresql_blob_backend(); - virtual std::size_t getLen(); - virtual std::size_t read(std::size_t offset, char *buf, + virtual std::size_t get_len(); + virtual std::size_t read(std::size_t offset, char * buf, std::size_t toRead); - virtual std::size_t write(std::size_t offset, char const *buf, + virtual std::size_t write(std::size_t offset, char const * buf, std::size_t toWrite); - virtual std::size_t append(char const *buf, std::size_t toWrite); + virtual std::size_t append(char const * buf, std::size_t toWrite); virtual void trim(std::size_t newLen); - PostgreSQLSessionBackEnd &session_; + postgresql_session_backend & session_; unsigned long oid_; // oid of the large object int fd_; // descriptor of the large object }; -struct PostgreSQLSessionBackEnd : details::SessionBackEnd +struct postgresql_session_backend : details::session_backend { - PostgreSQLSessionBackEnd(std::string const &connectString); + postgresql_session_backend(std::string const & connectString); - ~PostgreSQLSessionBackEnd(); + ~postgresql_session_backend(); virtual void begin(); virtual void commit(); virtual void rollback(); - void cleanUp(); + virtual std::string get_backend_name() const { return "postgresql"; } - virtual PostgreSQLStatementBackEnd * makeStatementBackEnd(); - virtual PostgreSQLRowIDBackEnd * makeRowIDBackEnd(); - virtual PostgreSQLBLOBBackEnd * makeBLOBBackEnd(); + void clean_up(); - std::string getNextStatementName(); + virtual postgresql_statement_backend * make_statement_backend(); + virtual postgresql_rowid_backend * make_rowid_backend(); + virtual postgresql_blob_backend * make_blob_backend(); + + std::string get_next_statement_name(); int statementCount_; - PGconn *conn_; + PGconn * conn_; }; -struct PostgreSQLBackEndFactory : BackEndFactory +struct postgresql_backend_factory : backend_factory { - virtual PostgreSQLSessionBackEnd * makeSession( - std::string const &connectString) const; + virtual postgresql_session_backend * make_session( + std::string const & connectString) const; }; -SOCI_POSTGRESQL_DECL extern PostgreSQLBackEndFactory const postgresql; +extern SOCI_POSTGRESQL_DECL postgresql_backend_factory const postgresql; -} // namespace SOCI +extern "C" +{ -#endif // SOCI_POSTGRESQL_H_INCLUDED +// for dynamic backend loading +SOCI_POSTGRESQL_DECL backend_factory const * factory_postgresql(); +} // extern "C" + +} // namespace soci + +#endif // SOCI_POSTGRESQL_H_INCLUDED diff --git a/src/backends/postgresql/standard-into-type.cpp b/src/backends/postgresql/standard-into-type.cpp index 50914d56..b02dd1bb 100644 --- a/src/backends/postgresql/standard-into-type.cpp +++ b/src/backends/postgresql/standard-into-type.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,11 +8,13 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" #include "common.h" -#include <soci.h> +#include "rowid.h" +#include "blob.h" #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> #include <cstring> +#include <cstdlib> #include <ctime> #include <sstream> @@ -20,31 +22,26 @@ #define SOCI_PGSQL_NOBINDBYNAME #endif // SOCI_PGSQL_NOPARAMS -#ifdef _MSC_VER -#pragma warning(disable:4355 4996) -#define strtoll(s, p, b) static_cast<long long>(_strtoi64(s, p, b)) -#endif +using namespace soci; +using namespace soci::details; +using namespace soci::details::postgresql; -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::PostgreSQL; - -void PostgreSQLStandardIntoTypeBackEnd::defineByPos( - int &position, void *data, eExchangeType type) +void postgresql_standard_into_type_backend::define_by_pos( + int & position, void * data, exchange_type type) { data_ = data; type_ = type; position_ = position++; } -void PostgreSQLStandardIntoTypeBackEnd::preFetch() +void postgresql_standard_into_type_backend::pre_fetch() { // nothing to do here } -void PostgreSQLStandardIntoTypeBackEnd::postFetch( - bool gotData, bool calledFromFetch, eIndicator *ind) +void postgresql_standard_into_type_backend::post_fetch( + bool gotData, bool calledFromFetch, indicator * ind) { if (calledFromFetch == true && gotData == false) { @@ -55,124 +52,126 @@ void PostgreSQLStandardIntoTypeBackEnd::postFetch( if (gotData) { - // PostgreSQL positions start at 0 - int pos = position_ - 1; + // postgresql_ positions start at 0 + int const pos = position_ - 1; // first, deal with indicators if (PQgetisnull(statement_.result_, statement_.currentRow_, pos) != 0) { if (ind == NULL) { - throw SOCIError( + throw soci_error( "Null value fetched and no indicator defined."); } - *ind = eNull; + *ind = i_null; + + // no need to convert data if it is null return; } else { if (ind != NULL) { - *ind = eOK; + *ind = i_ok; } } // raw data, in text format - char *buf = PQgetvalue(statement_.result_, + char const * buf = PQgetvalue(statement_.result_, statement_.currentRow_, pos); switch (type_) { - case eXChar: + case x_char: { - char *dest = static_cast<char*>(data_); + char * dest = static_cast<char *>(data_); *dest = *buf; } break; - case eXCString: + case x_cstring: { - CStringDescriptor *strDescr - = static_cast<CStringDescriptor *>(data_); + cstring_descriptor * strDescr + = static_cast<cstring_descriptor *>(data_); std::strncpy(strDescr->str_, buf, strDescr->bufSize_ - 1); strDescr->str_[strDescr->bufSize_ - 1] = '\0'; if (std::strlen(buf) >= strDescr->bufSize_ && ind != NULL) { - *ind = eTruncated; + *ind = i_truncated; } } break; - case eXStdString: + case x_stdstring: { - std::string *dest = static_cast<std::string *>(data_); + std::string * dest = static_cast<std::string *>(data_); dest->assign(buf); } break; - case eXShort: + case x_short: + { + short * dest = static_cast<short *>(data_); + *dest = string_to_integer<short>(buf); + } + break; + case x_integer: { - short *dest = static_cast<short*>(data_); - long val = strtol(buf, NULL, 10); - *dest = static_cast<short>(val); + int * dest = static_cast<int *>(data_); + *dest = string_to_integer<int>(buf); } break; - case eXInteger: + case x_unsigned_long: { - int *dest = static_cast<int*>(data_); - long val = strtol(buf, NULL, 10); - *dest = static_cast<int>(val); + unsigned long * dest = static_cast<unsigned long *>(data_); + *dest = string_to_integer<unsigned long>(buf); } break; - case eXUnsignedLong: + case x_long_long: { - unsigned long *dest = static_cast<unsigned long *>(data_); - long long val = strtoll(buf, NULL, 10); - *dest = static_cast<unsigned long>(val); + long long * dest = static_cast<long long *>(data_); + *dest = string_to_integer<long long>(buf); } break; - case eXDouble: + case x_double: { - double *dest = static_cast<double*>(data_); - double val = strtod(buf, NULL); - *dest = static_cast<double>(val); + double * dest = static_cast<double *>(data_); + *dest = string_to_double(buf); } break; - case eXStdTm: + case x_stdtm: { // attempt to parse the string and convert to std::tm - std::tm *dest = static_cast<std::tm *>(data_); - parseStdTm(buf, *dest); + std::tm * dest = static_cast<std::tm *>(data_); + parse_std_tm(buf, *dest); } break; - case eXRowID: + case x_rowid: { // RowID is internally identical to unsigned long - RowID *rid = static_cast<RowID *>(data_); - PostgreSQLRowIDBackEnd *rbe - = static_cast<PostgreSQLRowIDBackEnd *>( - rid->getBackEnd()); + rowid * rid = static_cast<rowid *>(data_); + postgresql_rowid_backend * rbe + = static_cast<postgresql_rowid_backend *>( + rid->get_backend()); - long long val = strtoll(buf, NULL, 10); - rbe->value_ = static_cast<unsigned long>(val); + rbe->value_ = string_to_integer<unsigned long>(buf); } break; - case eXBLOB: + case x_blob: { - long long llval = strtoll(buf, NULL, 10); - unsigned long oid = static_cast<unsigned long>(llval); + unsigned long oid = string_to_integer<unsigned long>(buf); int fd = lo_open(statement_.session_.conn_, oid, INV_READ | INV_WRITE); if (fd == -1) { - throw SOCIError("Cannot open the BLOB object."); + throw soci_error("Cannot open the blob object."); } - BLOB *b = static_cast<BLOB *>(data_); - PostgreSQLBLOBBackEnd *bbe - = static_cast<PostgreSQLBLOBBackEnd *>(b->getBackEnd()); + blob * b = static_cast<blob *>(data_); + postgresql_blob_backend *bbe + = static_cast<postgresql_blob_backend *>(b->get_backend()); if (bbe->fd_ != -1) { @@ -184,23 +183,12 @@ void PostgreSQLStandardIntoTypeBackEnd::postFetch( break; default: - throw SOCIError("Into element used with non-supported type."); - } - } - else // no data retrieved - { - if (ind != NULL) - { - *ind = eNoData; - } - else - { - throw SOCIError("No data fetched and no indicator defined."); + throw soci_error("Into element used with non-supported type."); } } } -void PostgreSQLStandardIntoTypeBackEnd::cleanUp() +void postgresql_standard_into_type_backend::clean_up() { // nothing to do here } diff --git a/src/backends/postgresql/standard-use-type.cpp b/src/backends/postgresql/standard-use-type.cpp index 2759e4c7..de4a7aeb 100644 --- a/src/backends/postgresql/standard-use-type.cpp +++ b/src/backends/postgresql/standard-use-type.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,7 +7,7 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" -#include <soci.h> +#include "rowid.h" #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> @@ -23,33 +23,37 @@ #ifdef _MSC_VER #pragma warning(disable:4355 4996) #define snprintf _snprintf -#else -using std::snprintf; #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; -void PostgreSQLStandardUseTypeBackEnd::bindByPos( - int &position, void *data, eExchangeType type) +void postgresql_standard_use_type_backend::bind_by_pos( + int & position, void * data, exchange_type type, bool /* readOnly */) { + // readOnly is ignored, because PostgreSQL does not support + // any data to be written back to used (bound) objects. + data_ = data; type_ = type; position_ = position++; } -void PostgreSQLStandardUseTypeBackEnd::bindByName( - std::string const &name, void *data, eExchangeType type) +void postgresql_standard_use_type_backend::bind_by_name( + std::string const & name, void * data, exchange_type type, bool /* readOnly */) { + // readOnly is ignored, because PostgreSQL does not support + // any data to be written back to used (bound) objects. + data_ = data; type_ = type; name_ = name; } -void PostgreSQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) +void postgresql_standard_use_type_backend::pre_use(indicator const * ind) { - if (ind != NULL && *ind == eNull) + if (ind != NULL && *ind == i_null) { // leave the working buffer as NULL } @@ -58,58 +62,67 @@ void PostgreSQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) // allocate and fill the buffer with text-formatted client data switch (type_) { - case eXChar: + case x_char: { buf_ = new char[2]; - buf_[0] = *static_cast<char*>(data_); + buf_[0] = *static_cast<char *>(data_); buf_[1] = '\0'; } break; - case eXCString: + case x_cstring: { - CStringDescriptor *strDescr - = static_cast<CStringDescriptor *>(data_); + cstring_descriptor * strDescr + = static_cast<cstring_descriptor *>(data_); std::size_t len = std::strlen(strDescr->str_); buf_ = new char[len + 1]; std::strcpy(buf_, strDescr->str_); } break; - case eXStdString: + case x_stdstring: { - std::string *s = static_cast<std::string *>(data_); + std::string * s = static_cast<std::string *>(data_); buf_ = new char[s->size() + 1]; std::strcpy(buf_, s->c_str()); } break; - case eXShort: + case x_short: { std::size_t const bufSize = std::numeric_limits<short>::digits10 + 3; buf_ = new char[bufSize]; snprintf(buf_, bufSize, "%d", - static_cast<int>(*static_cast<short*>(data_))); + static_cast<int>(*static_cast<short *>(data_))); } break; - case eXInteger: + case x_integer: { std::size_t const bufSize = std::numeric_limits<int>::digits10 + 3; buf_ = new char[bufSize]; snprintf(buf_, bufSize, "%d", - *static_cast<int*>(data_)); + *static_cast<int *>(data_)); } break; - case eXUnsignedLong: + case x_unsigned_long: { std::size_t const bufSize = std::numeric_limits<unsigned long>::digits10 + 2; buf_ = new char[bufSize]; snprintf(buf_, bufSize, "%lu", - *static_cast<unsigned long*>(data_)); + *static_cast<unsigned long *>(data_)); + } + break; + case x_long_long: + { + std::size_t const bufSize + = std::numeric_limits<long long>::digits10 + 3; + buf_ = new char[bufSize]; + snprintf(buf_, bufSize, "%lld", + *static_cast<long long *>(data_)); } break; - case eXDouble: + case x_double: { // no need to overengineer it (KISS)... @@ -117,28 +130,28 @@ void PostgreSQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) buf_ = new char[bufSize]; snprintf(buf_, bufSize, "%.20g", - *static_cast<double*>(data_)); + *static_cast<double *>(data_)); } break; - case eXStdTm: + case x_stdtm: { std::size_t const bufSize = 20; buf_ = new char[bufSize]; - std::tm *t = static_cast<std::tm *>(data_); + std::tm * t = static_cast<std::tm *>(data_); snprintf(buf_, bufSize, "%d-%02d-%02d %02d:%02d:%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } break; - case eXRowID: + case x_rowid: { // RowID is internally identical to unsigned long - RowID *rid = static_cast<RowID *>(data_); - PostgreSQLRowIDBackEnd *rbe - = static_cast<PostgreSQLRowIDBackEnd *>( - rid->getBackEnd()); + rowid * rid = static_cast<rowid *>(data_); + postgresql_rowid_backend * rbe + = static_cast<postgresql_rowid_backend *>( + rid->get_backend()); std::size_t const bufSize = std::numeric_limits<unsigned long>::digits10 + 2; @@ -149,7 +162,7 @@ void PostgreSQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) break; default: - throw SOCIError("Use element used with non-supported type."); + throw soci_error("Use element used with non-supported type."); } } @@ -165,18 +178,20 @@ void PostgreSQLStandardUseTypeBackEnd::preUse(eIndicator const *ind) } } -void PostgreSQLStandardUseTypeBackEnd::postUse( - bool /* gotData */, eIndicator * /* ind */) +void postgresql_standard_use_type_backend::post_use( + bool /* gotData */, indicator * /* ind */) { - // TODO: if PostgreSQL allows to *get* data via this channel, - // write it back to client buffers (variable) + // PostgreSQL does not support any data moving back the same channel, + // so there is nothing to do here. + // In particular, there is nothing to protect, because both const and non-const + // objects will never be modified. // clean up the working buffer, it might be allocated anew in // the next run of preUse - cleanUp(); + clean_up(); } -void PostgreSQLStandardUseTypeBackEnd::cleanUp() +void postgresql_standard_use_type_backend::clean_up() { if (buf_ != NULL) { diff --git a/src/backends/postgresql/statement.cpp b/src/backends/postgresql/statement.cpp index ad4de507..d8061c21 100644 --- a/src/backends/postgresql/statement.cpp +++ b/src/backends/postgresql/statement.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -7,7 +7,6 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" -#include <soci.h> #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> @@ -23,24 +22,24 @@ #pragma warning(disable:4355) #endif -using namespace SOCI; -using namespace SOCI::details; +using namespace soci; +using namespace soci::details; -PostgreSQLStatementBackEnd::PostgreSQLStatementBackEnd( - PostgreSQLSessionBackEnd &session) +postgresql_statement_backend::postgresql_statement_backend( + postgresql_session_backend &session) : session_(session), result_(NULL), justDescribed_(false), hasIntoElements_(false), hasVectorIntoElements_(false), hasUseElements_(false), hasVectorUseElements_(false) { } -void PostgreSQLStatementBackEnd::alloc() +void postgresql_statement_backend::alloc() { // nothing to do here } -void PostgreSQLStatementBackEnd::cleanUp() +void postgresql_statement_backend::clean_up() { if (result_ != NULL) { @@ -49,16 +48,16 @@ void PostgreSQLStatementBackEnd::cleanUp() } } -void PostgreSQLStatementBackEnd::prepare(std::string const &query, - eStatementType eType) +void postgresql_statement_backend::prepare(std::string const & query, + statement_type stType) { #ifdef SOCI_PGSQL_NOBINDBYNAME query_ = query; #else // rewrite the query by transforming all named parameters into - // the PostgreSQL numbers ones (:abc -> $1, etc.) + // the postgresql_ numbers ones (:abc -> $1, etc.) - enum { eNormal, eInQuotes, eInName } state = eNormal; + enum { normal, in_quotes, in_name } state = normal; std::string name; int position = 1; @@ -68,33 +67,33 @@ void PostgreSQLStatementBackEnd::prepare(std::string const &query, { switch (state) { - case eNormal: + case normal: if (*it == '\'') { query_ += *it; - state = eInQuotes; + state = in_quotes; } else if (*it == ':') { - state = eInName; + state = in_name; } else // regular character, stay in the same state { query_ += *it; } break; - case eInQuotes: + case in_quotes: if (*it == '\'') { query_ += *it; - state = eNormal; + state = normal; } else // regular quoted character { query_ += *it; } break; - case eInName: + case in_name: if (std::isalnum(*it) || *it == '_') { name += *it; @@ -107,13 +106,13 @@ void PostgreSQLStatementBackEnd::prepare(std::string const &query, ss << '$' << position++; query_ += ss.str(); query_ += *it; - state = eNormal; + state = normal; } break; } } - if (state == eInName) + if (state == in_name) { names_.push_back(name); std::ostringstream ss; @@ -125,31 +124,31 @@ void PostgreSQLStatementBackEnd::prepare(std::string const &query, #ifndef SOCI_PGSQL_NOPREPARE - if (eType == eRepeatableQuery) + if (stType == st_repeatable_query) { - statementName_ = session_.getNextStatementName(); + statementName_ = session_.get_next_statement_name(); - PGresult *res = PQprepare(session_.conn_, statementName_.c_str(), + PGresult * res = PQprepare(session_.conn_, statementName_.c_str(), query_.c_str(), static_cast<int>(names_.size()), NULL); if (res == NULL) { - throw SOCIError("Cannot prepare statement."); + throw soci_error("Cannot prepare statement."); } ExecStatusType status = PQresultStatus(res); if (status != PGRES_COMMAND_OK) { - throw SOCIError(PQresultErrorMessage(res)); + throw soci_error(PQresultErrorMessage(res)); } PQclear(res); } - eType_ = eType; + stType_ = stType; #endif // SOCI_PGSQL_NOPREPARE } -StatementBackEnd::execFetchResult -PostgreSQLStatementBackEnd::execute(int number) +statement_backend::exec_fetch_result +postgresql_statement_backend::execute(int number) { // If the statement was "just described", then we know that // it was actually executed with all the use elements @@ -160,15 +159,15 @@ PostgreSQLStatementBackEnd::execute(int number) if (justDescribed_ == false) { // This object could have been already filled with data before. - cleanUp(); + clean_up(); if (number > 1 && hasIntoElements_) { - throw SOCIError( + throw soci_error( "Bulk use with single into elements is not supported."); } - // Since the bulk operations are not natively supported by PostgreSQL, + // Since the bulk operations are not natively supported by postgresql_, // we have to explicitly loop to achieve the bulk operations. // On the other hand, looping is not needed if there are single // use elements, even if there is a bulk fetch. @@ -183,11 +182,13 @@ PostgreSQLStatementBackEnd::execute(int number) numberOfExecutions = hasUseElements_ ? 1 : number; } - if (!useByPosBuffers_.empty() || !useByNameBuffers_.empty()) + if ((useByPosBuffers_.empty() == false) || + (useByNameBuffers_.empty() == false)) { - if (!useByPosBuffers_.empty() && !useByNameBuffers_.empty()) + if ((useByPosBuffers_.empty() == false) && + (useByNameBuffers_.empty() == false)) { - throw SOCIError( + throw soci_error( "Binding for use elements must be either by position " "or by name."); } @@ -196,7 +197,7 @@ PostgreSQLStatementBackEnd::execute(int number) { std::vector<char *> paramValues; - if (!useByPosBuffers_.empty()) + if (useByPosBuffers_.empty() == false) { // use elements bind by position // the map of use buffers can be traversed @@ -207,7 +208,7 @@ PostgreSQLStatementBackEnd::execute(int number) end = useByPosBuffers_.end(); it != end; ++it) { - char **buffers = it->second; + char ** buffers = it->second; paramValues.push_back(buffers[i]); } } @@ -227,16 +228,16 @@ PostgreSQLStatementBackEnd::execute(int number) "Missing use element for bind by name ("); msg += *it; msg += ")."; - throw SOCIError(msg); + throw soci_error(msg); } - char **buffers = b->second; + char ** buffers = b->second; paramValues.push_back(buffers[i]); } } #ifdef SOCI_PGSQL_NOPARAMS - throw SOCIError("Queries with parameters are not supported."); + throw soci_error("Queries with parameters are not supported."); #else @@ -248,7 +249,7 @@ PostgreSQLStatementBackEnd::execute(int number) #else - if (eType_ == eRepeatableQuery) + if (stType_ == st_repeatable_query) { // this query was separately prepared @@ -257,7 +258,7 @@ PostgreSQLStatementBackEnd::execute(int number) static_cast<int>(paramValues.size()), ¶mValues[0], NULL, NULL, 0); } - else // eType_ == eOneTimeQuery + else // stType_ == st_one_time_query { // this query was not separately prepared and should // be executed as a one-time query @@ -276,13 +277,13 @@ PostgreSQLStatementBackEnd::execute(int number) // there are only bulk use elements (no intos) if (result_ == NULL) { - throw SOCIError("Cannot execute query."); + throw soci_error("Cannot execute query."); } ExecStatusType status = PQresultStatus(result_); if (status != PGRES_COMMAND_OK) { - throw SOCIError(PQresultErrorMessage(result_)); + throw soci_error(PQresultErrorMessage(result_)); } PQclear(result_); } @@ -292,7 +293,7 @@ PostgreSQLStatementBackEnd::execute(int number) { // it was a bulk operation result_ = NULL; - return eNoData; + return ef_no_data; } // otherwise (no bulk), follow the code below @@ -307,14 +308,14 @@ PostgreSQLStatementBackEnd::execute(int number) result_ = PQexec(session_.conn_, query_.c_str()); #else - if (eType_ == eRepeatableQuery) + if (stType_ == st_repeatable_query) { // this query was separately prepared result_ = PQexecPrepared(session_.conn_, statementName_.c_str(), 0, NULL, NULL, NULL, 0); } - else // eType_ == eOneTimeQuery + else // stType_ == st_one_time_query { result_ = PQexec(session_.conn_, query_.c_str()); } @@ -323,7 +324,7 @@ PostgreSQLStatementBackEnd::execute(int number) if (result_ == NULL) { - throw SOCIError("Cannot execute query."); + throw soci_error("Cannot execute query."); } } } @@ -346,7 +347,7 @@ PostgreSQLStatementBackEnd::execute(int number) numberOfRows_ = PQntuples(result_); if (numberOfRows_ == 0) { - return eNoData; + return ef_no_data; } else { @@ -358,22 +359,22 @@ PostgreSQLStatementBackEnd::execute(int number) else { // execute(0) was meant to only perform the query - return eSuccess; + return ef_success; } } } else if (status == PGRES_COMMAND_OK) { - return eNoData; + return ef_no_data; } else { - throw SOCIError(PQresultErrorMessage(result_)); + throw soci_error(PQresultErrorMessage(result_)); } } -StatementBackEnd::execFetchResult -PostgreSQLStatementBackEnd::fetch(int number) +statement_backend::exec_fetch_result +postgresql_statement_backend::fetch(int number) { // Note: This function does not actually fetch anything from anywhere // - the data was already retrieved from the server in the execute() @@ -387,7 +388,7 @@ PostgreSQLStatementBackEnd::fetch(int number) if (currentRow_ >= numberOfRows_) { // all rows were already consumed - return eNoData; + return ef_no_data; } else { @@ -396,32 +397,32 @@ PostgreSQLStatementBackEnd::fetch(int number) rowsToConsume_ = numberOfRows_ - currentRow_; // this simulates the behaviour of Oracle - // - when EOF is hit, we return eNoData even when there are + // - when EOF is hit, we return ef_no_data even when there are // actually some rows fetched - return eNoData; + return ef_no_data; } else { rowsToConsume_ = number; - return eSuccess; + return ef_success; } } } -int PostgreSQLStatementBackEnd::getNumberOfRows() +int postgresql_statement_backend::get_number_of_rows() { return numberOfRows_ - currentRow_; } -std::string PostgreSQLStatementBackEnd::rewriteForProcedureCall( - std::string const &query) +std::string postgresql_statement_backend::rewrite_for_procedure_call( + std::string const & query) { std::string newQuery("select "); newQuery += query; return newQuery; } -int PostgreSQLStatementBackEnd::prepareForDescribe() +int postgresql_statement_backend::prepare_for_describe() { execute(1); justDescribed_ = true; @@ -430,13 +431,13 @@ int PostgreSQLStatementBackEnd::prepareForDescribe() return columns; } -void PostgreSQLStatementBackEnd::describeColumn(int colNum, eDataType &type, - std::string &columnName) +void postgresql_statement_backend::describe_column(int colNum, data_type & type, + std::string & columnName) { - // In PostgreSQL column numbers start from 0 - int pos = colNum - 1; + // In postgresql_ column numbers start from 0 + int const pos = colNum - 1; - unsigned long typeOid = PQftype(result_, pos); + unsigned long const typeOid = PQftype(result_, pos); switch (typeOid) { // Note: the following list of OIDs was taken from the pg_type table @@ -449,7 +450,7 @@ void PostgreSQLStatementBackEnd::describeColumn(int colNum, eDataType &type, case 2275: // cstring case 18: // char case 1042: // bpchar - type = eString; + type = dt_string; break; case 702: // abstime @@ -459,57 +460,60 @@ void PostgreSQLStatementBackEnd::describeColumn(int colNum, eDataType &type, case 1114: // timestamp case 1184: // timestamptz case 1266: // timetz - type = eDate; + type = dt_date; break; case 700: // float4 case 701: // float8 case 1700: // numeric - type = eDouble; + type = dt_double; break; case 16: // bool case 21: // int2 case 23: // int4 + type = dt_integer; + break; + case 20: // int8 - type = eInteger; + type = dt_long_long; break; case 26: // oid - type = eUnsignedLong; + type = dt_unsigned_long; break; default: - throw SOCIError("Unknown data type."); + throw soci_error("Unknown data type."); } columnName = PQfname(result_, pos); } -PostgreSQLStandardIntoTypeBackEnd * -PostgreSQLStatementBackEnd::makeIntoTypeBackEnd() +postgresql_standard_into_type_backend * +postgresql_statement_backend::make_into_type_backend() { hasIntoElements_ = true; - return new PostgreSQLStandardIntoTypeBackEnd(*this); + return new postgresql_standard_into_type_backend(*this); } -PostgreSQLStandardUseTypeBackEnd * -PostgreSQLStatementBackEnd::makeUseTypeBackEnd() +postgresql_standard_use_type_backend * +postgresql_statement_backend::make_use_type_backend() { hasUseElements_ = true; - return new PostgreSQLStandardUseTypeBackEnd(*this); + return new postgresql_standard_use_type_backend(*this); } -PostgreSQLVectorIntoTypeBackEnd * -PostgreSQLStatementBackEnd::makeVectorIntoTypeBackEnd() +postgresql_vector_into_type_backend * +postgresql_statement_backend::make_vector_into_type_backend() { hasVectorIntoElements_ = true; - return new PostgreSQLVectorIntoTypeBackEnd(*this); + return new postgresql_vector_into_type_backend(*this); } -PostgreSQLVectorUseTypeBackEnd * -PostgreSQLStatementBackEnd::makeVectorUseTypeBackEnd() +postgresql_vector_use_type_backend * +postgresql_statement_backend::make_vector_use_type_backend() { hasVectorUseElements_ = true; - return new PostgreSQLVectorUseTypeBackEnd(*this); + return new postgresql_vector_use_type_backend(*this); } diff --git a/src/backends/postgresql/test/Makefile.am b/src/backends/postgresql/test/Makefile.am deleted file mode 100644 index 4667737b..00000000 --- a/src/backends/postgresql/test/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:32 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/core/test \ - -I$(top_srcdir)/src/backends/postgresql - -AM_CPPFLAGS = @POSTGRESQL_CFLAGS@ -AM_LDFLAGS = @POSTGRESQL_LDFLAGS@ - -noinst_PROGRAMS = \ - test_postgresql - -test_postgresql_SOURCES = \ - test-postgresql.cpp - -test_postgresql_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/postgresql/lib@SOCI_POSTGRESQL_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/postgresql/test/Makefile.basic b/src/backends/postgresql/test/Makefile.basic index 68fe5d1f..9c94275e 100644 --- a/src/backends/postgresql/test/Makefile.basic +++ b/src/backends/postgresql/test/Makefile.basic @@ -11,7 +11,7 @@ COMPILER = g++ CXXFLAGS = -Wall -pedantic -Wno-long-long INCLUDEDIRS = -I.. -I../../../core/test -I../../../core ${PGSQLINCLUDEDIR} LIBDIRS = -L.. -L../../../core ${PGSQLLIBDIR} -LIBS = -lsoci-core -lsoci-postgresql ${PGSQLLIBS} +LIBS = -lsoci_core -lsoci_postgresql -ldl ${PGSQLLIBS} test-postgresql : test-postgresql.cpp diff --git a/src/backends/postgresql/test/Makefile.in b/src/backends/postgresql/test/Makefile.in deleted file mode 100644 index c53f0792..00000000 --- a/src/backends/postgresql/test/Makefile.in +++ /dev/null @@ -1,484 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -noinst_PROGRAMS = test_postgresql$(EXEEXT) -subdir = src/backends/postgresql/test -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_test_postgresql_OBJECTS = test-postgresql.$(OBJEXT) -test_postgresql_OBJECTS = $(am_test_postgresql_OBJECTS) -test_postgresql_DEPENDENCIES = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/postgresql/lib@SOCI_POSTGRESQL_LIBRARY_NAME@.la -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(test_postgresql_SOURCES) -DIST_SOURCES = $(test_postgresql_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:32 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/core/test \ - -I$(top_srcdir)/src/backends/postgresql - -AM_CPPFLAGS = @POSTGRESQL_CFLAGS@ -AM_LDFLAGS = @POSTGRESQL_LDFLAGS@ -test_postgresql_SOURCES = \ - test-postgresql.cpp - -test_postgresql_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/postgresql/lib@SOCI_POSTGRESQL_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/postgresql/test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/postgresql/test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_postgresql$(EXEEXT): $(test_postgresql_OBJECTS) $(test_postgresql_DEPENDENCIES) - @rm -f test_postgresql$(EXEEXT) - $(CXXLINK) $(test_postgresql_LDFLAGS) $(test_postgresql_OBJECTS) $(test_postgresql_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-postgresql.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/postgresql/test/test-postgresql.cpp b/src/backends/postgresql/test/test-postgresql.cpp index 866ddac0..fc932c24 100644 --- a/src/backends/postgresql/test/test-postgresql.cpp +++ b/src/backends/postgresql/test/test-postgresql.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -16,20 +16,20 @@ #include <ctime> #include <cstdlib> -using namespace SOCI; -using namespace SOCI::tests; +using namespace soci; +using namespace soci::tests; std::string connectString; -BackEndFactory const &backEnd = postgresql; +backend_factory const &backEnd = postgresql; // Postgres-specific tests -struct OidTableCreator : public TableCreatorBase +struct oid_table_creator : public table_creator_base { - OidTableCreator(Session& session) - : TableCreatorBase(session) + oid_table_creator(session& sql) + : table_creator_base(sql) { - session << "create table soci_test (" + sql << "create table soci_test (" " id integer," " name varchar(100)" ") with oids"; @@ -43,13 +43,13 @@ struct OidTableCreator : public TableCreatorBase void test1() { { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); - OidTableCreator tableCreator(sql); + oid_table_creator tableCreator(sql); sql << "insert into soci_test(id, name) values(7, \'John\')"; - RowID rid(sql); + rowid rid(sql); sql << "select oid from soci_test where id = 7", into(rid); int id; @@ -63,8 +63,8 @@ void test1() #else // Older PostgreSQL does not support use elements. - PostgreSQLRowIDBackEnd *rbe - = static_cast<PostgreSQLRowIDBackEnd *>(rid.getBackEnd()); + postgresql_rowid_backend *rbe + = static_cast<postgresql_rowid_backend *>(rid.get_backend()); unsigned long oid = rbe->value_; @@ -81,17 +81,17 @@ void test1() } // function call test -class FunctionCreator : FunctionCreatorBase +class function_creator : function_creator_base { public: - FunctionCreator(Session& session) - : FunctionCreatorBase(session) + function_creator(session& session) + : function_creator_base(session) { // before a language can be used it must be defined // if it has already been defined then an error will occur try { session << "create language plpgsql"; } - catch (SOCIError const &) {} // ignore if error + catch (soci_error const &) {} // ignore if error #ifndef SOCI_PGSQL_NOPARAMS @@ -109,12 +109,12 @@ public: "begin " " return $1; " "end \' language plpgsql"; -#endif +#endif } protected: - std::string dropStatement() + std::string drop_statement() { return "drop function soci_test(varchar)"; } @@ -123,16 +123,16 @@ protected: void test2() { { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); - FunctionCreator functionCreator(sql); + function_creator functionCreator(sql); std::string in("my message"); std::string out; #ifndef SOCI_PGSQL_NOPARAMS - Statement st = (sql.prepare << + statement st = (sql.prepare << "select soci_test(:input)", into(out), use(in, "input")); @@ -140,9 +140,7 @@ void test2() #else // Older PostgreSQL does not support use elements. - std::string in("my message"); - std::string out; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select soci_test(\'" << in << "\')", into(out)); @@ -158,14 +156,14 @@ void test2() #ifndef SOCI_PGSQL_NOPARAMS - Procedure proc = (sql.prepare << + procedure proc = (sql.prepare << "soci_test(:input)", into(out), use(in, "input")); #else // Older PostgreSQL does not support use elements. - Procedure proc = (sql.prepare << + procedure proc = (sql.prepare << "soci_test(\'" << in << "\')", into(out)); #endif // SOCI_PGSQL_NOPARAMS @@ -179,10 +177,10 @@ void test2() } // BLOB test -struct BlobTableCreator : public TableCreatorBase +struct blob_table_creator : public table_creator_base { - BlobTableCreator(Session& session) - : TableCreatorBase(session) + blob_table_creator(session& session) + : table_creator_base(session) { session << "create table soci_test (" @@ -195,33 +193,33 @@ struct BlobTableCreator : public TableCreatorBase void test3() { { - Session sql(backEnd, connectString); + session sql(backEnd, connectString); - BlobTableCreator tableCreator(sql); + blob_table_creator tableCreator(sql); char buf[] = "abcdefghijklmnopqrstuvwxyz"; sql << "insert into soci_test(id, img) values(7, lo_creat(-1))"; - // in PostgreSQL, BLOB operations must be withing transaction block - sql.begin(); + // in PostgreSQL, BLOB operations must be within transaction block + transaction tr(sql); { - BLOB b(sql); + blob b(sql); sql << "select img from soci_test where id = 7", into(b); - assert(b.getLen() == 0); + assert(b.get_len() == 0); b.write(0, buf, sizeof(buf)); - assert(b.getLen() == sizeof(buf)); + assert(b.get_len() == sizeof(buf)); b.append(buf, sizeof(buf)); - assert(b.getLen() == 2 * sizeof(buf)); + assert(b.get_len() == 2 * sizeof(buf)); } { - BLOB b(sql); + blob b(sql); sql << "select img from soci_test where id = 7", into(b); - assert(b.getLen() == 2 * sizeof(buf)); + assert(b.get_len() == 2 * sizeof(buf)); char buf2[100]; b.read(0, buf2, 10); assert(strncmp(buf2, "abcdefghij", 10) == 0); @@ -230,40 +228,199 @@ void test3() unsigned long oid; sql << "select img from soci_test where id = 7", into(oid); sql << "select lo_unlink(" << oid << ")"; - - sql.commit(); } std::cout << "test 3 passed" << std::endl; } +struct longlong_table_creator : table_creator_base +{ + longlong_table_creator(session & sql) + : table_creator_base(sql) + { + sql << "create table soci_test(val int8)"; + } +}; + +// long long test +void test4() +{ + { + session sql(backEnd, connectString); + + longlong_table_creator tableCreator(sql); + + long long v1 = 1000000000000LL; + assert(v1 / 1000000 == 1000000); + + sql << "insert into soci_test(val) values(:val)", use(v1); + + long long v2 = 0LL; + sql << "select val from soci_test", into(v2); + + assert(v2 == v1); + } + + // vector<long long> + { + session sql(backEnd, connectString); + + longlong_table_creator tableCreator(sql); + + std::vector<long long> v1; + v1.push_back(1000000000000LL); + v1.push_back(1000000000001LL); + v1.push_back(1000000000002LL); + v1.push_back(1000000000003LL); + v1.push_back(1000000000004LL); + + sql << "insert into soci_test(val) values(:val)", use(v1); + + std::vector<long long> v2(10); + sql << "select val from soci_test order by val desc", into(v2); + + assert(v2.size() == 5); + assert(v2[0] == 1000000000004LL); + assert(v2[1] == 1000000000003LL); + assert(v2[2] == 1000000000002LL); + assert(v2[3] == 1000000000001LL); + assert(v2[4] == 1000000000000LL); + } + + std::cout << "test 4 passed" << std::endl; +} + +struct boolean_table_creator : table_creator_base +{ + boolean_table_creator(session & sql) + : table_creator_base(sql) + { + sql << "create table soci_test(val boolean)"; + } +}; + +void test5() +{ + { + session sql(backEnd, connectString); + + boolean_table_creator tableCreator(sql); + + int i1 = 0; + + sql << "insert into soci_test(val) values(:val)", use(i1); + + int i2 = 7; + sql << "select val from soci_test", into(i2); + + assert(i2 == i1); + + sql << "update soci_test set val = true"; + sql << "select val from soci_test", into(i2); + assert(i2 == 1); + } + + std::cout << "test 5 passed" << std::endl; +} + +// dynamic backend test +void test6() +{ + try + { + session sql("nosuchbackend://" + connectString); + assert(false); + } + catch (soci_error const & e) + { + assert(e.what() == std::string("Failed to open: libsoci_nosuchbackend.so")); + } + + { + dynamic_backends::register_backend("pgsql", backEnd); + + std::vector<std::string> backends = dynamic_backends::list_all(); + assert(backends.size() == 1); + assert(backends[0] == "pgsql"); + + { + session sql("pgsql://" + connectString); + } + + dynamic_backends::unload("pgsql"); + + backends = dynamic_backends::list_all(); + assert(backends.empty()); + } + + { + session sql("postgresql://" + connectString); + } + + std::cout << "test 6 passed" << std::endl; +} + +void test7() +{ + { + session sql(backEnd, connectString); + + int i; + sql << "select 123", into(i); + assert(i == 123); + + try + { + sql << "select 'ABC'", into (i); + assert(false); + } + catch (soci_error const & e) + { + assert(e.what() == std::string("Cannot convert data.")); + } + } + + std::cout << "test 7 passed" << std::endl; +} + +void test8() +{ + { + session sql(backEnd, connectString); + + assert(sql.get_backend_name() == "postgresql"); + } + + std::cout << "test 8 passed" << std::endl; +} + // DDL Creation objects for common tests -struct TableCreator1 : public TableCreatorBase +struct table_creator_one : public table_creator_base { - TableCreator1(Session& session) - : TableCreatorBase(session) + table_creator_one(session& session) + : table_creator_base(session) { session << "create table soci_test(id integer, val integer, c char, " "str varchar(20), sh int2, ul numeric(20), d float8, " - "tm timestamp, i1 integer, i2 integer, i3 integer, " + "tm timestamp, i1 integer, i2 integer, i3 integer, " "name varchar(20))"; } }; -struct TableCreator2 : public TableCreatorBase +struct table_creator_two : public table_creator_base { - TableCreator2(Session& session) - : TableCreatorBase(session) + table_creator_two(session& session) + : table_creator_base(session) { session << "create table soci_test(num_float float8, num_int integer," " name varchar(20), sometime timestamp, chr char)"; } }; -struct TableCreator3 : public TableCreatorBase +struct table_creator_three : public table_creator_base { - TableCreator3(Session& session) - : TableCreatorBase(session) + table_creator_three(session& session) + : table_creator_base(session) { session << "create table soci_test(name varchar(100) not null, " "phone varchar(15))"; @@ -271,39 +428,39 @@ struct TableCreator3 : public TableCreatorBase }; // -// Support for SOCI Common Tests +// Support for soci Common Tests // -class TestContext : public TestContextBase +class test_context : public test_context_base { public: - TestContext(BackEndFactory const &backEnd, + test_context(backend_factory const &backEnd, std::string const &connectString) - : TestContextBase(backEnd, connectString) {} + : test_context_base(backEnd, connectString) {} - TableCreatorBase* tableCreator1(Session& s) const + table_creator_base* table_creator_1(session& s) const { - return new TableCreator1(s); + return new table_creator_one(s); } - TableCreatorBase* tableCreator2(Session& s) const + table_creator_base* table_creator_2(session& s) const { - return new TableCreator2(s); + return new table_creator_two(s); } - TableCreatorBase* tableCreator3(Session& s) const + table_creator_base* table_creator_3(session& s) const { - return new TableCreator3(s); + return new table_creator_three(s); } - std::string toDateTime(std::string const &dateString) const + std::string to_date_time(std::string const &datdt_string) const { - return "timestamptz(\'" + dateString + "\')"; + return "timestamptz(\'" + datdt_string + "\')"; } }; - + int main(int argc, char** argv) { @@ -331,8 +488,8 @@ int main(int argc, char** argv) try { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); + test_context tc(backEnd, connectString); + common_tests tests(tc); tests.run(); std::cout << "\nSOCI Postgres Tests:\n\n"; @@ -340,6 +497,14 @@ int main(int argc, char** argv) test1(); test2(); test3(); + test4(); + test5(); + +// test6(); + std::cout << "test 6 skipped (dynamic backend)\n"; + + test7(); + test8(); std::cout << "\nOK, all tests passed.\n\n"; return EXIT_SUCCESS; diff --git a/src/backends/postgresql/vector-into-type.cpp b/src/backends/postgresql/vector-into-type.cpp index 62e66011..c327e6f7 100644 --- a/src/backends/postgresql/vector-into-type.cpp +++ b/src/backends/postgresql/vector-into-type.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,7 +8,6 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" #include "common.h" -#include <soci.h> #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> @@ -20,25 +19,20 @@ #define SOCI_PGSQL_NOBINDBYNAME #endif // SOCI_PGSQL_NOPARAMS -#ifdef _MSC_VER -#pragma warning(disable:4355) -#define strtoll(s, p, b) static_cast<long long>(_strtoi64(s, p, b)) -#endif +using namespace soci; +using namespace soci::details; +using namespace soci::details::postgresql; -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::PostgreSQL; - -void PostgreSQLVectorIntoTypeBackEnd::defineByPos( - int &position, void *data, eExchangeType type) +void postgresql_vector_into_type_backend::define_by_pos( + int & position, void * data, exchange_type type) { data_ = data; type_ = type; position_ = position++; } -void PostgreSQLVectorIntoTypeBackEnd::preFetch() +void postgresql_vector_into_type_backend::pre_fetch() { // nothing to do here } @@ -46,27 +40,27 @@ void PostgreSQLVectorIntoTypeBackEnd::preFetch() namespace // anonymous { -template <typename T, typename U> -void setInVector(void *p, int indx, U const &val) +template <typename T> +void set_invector_(void * p, int indx, T const & val) { - std::vector<T> *dest = + std::vector<T> * dest = static_cast<std::vector<T> *>(p); - std::vector<T> &v = *dest; + std::vector<T> & v = *dest; v[indx] = val; } } // namespace anonymous -void PostgreSQLVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) +void postgresql_vector_into_type_backend::post_fetch(bool gotData, indicator * ind) { if (gotData) { // Here, rowsToConsume_ in the Statement object designates // the number of rows that need to be put in the user's buffers. - // PostgreSQL column positions start at 0 - int pos = position_ - 1; + // postgresql_ column positions start at 0 + int const pos = position_ - 1; int const endRow = statement_.currentRow_ + statement_.rowsToConsume_; @@ -78,68 +72,76 @@ void PostgreSQLVectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator *ind) { if (ind == NULL) { - throw SOCIError( + throw soci_error( "Null value fetched and no indicator defined."); } - ind[i] = eNull; + ind[i] = i_null; + + // no need to convert data if it is null, go to next row + continue; } else { if (ind != NULL) { - ind[i] = eOK; + ind[i] = i_ok; } } // buffer with data retrieved from server, in text format - char *buf = PQgetvalue(statement_.result_, curRow, pos); + char * buf = PQgetvalue(statement_.result_, curRow, pos); switch (type_) { - case eXChar: - setInVector<char>(data_, i, *buf); + case x_char: + set_invector_(data_, i, *buf); break; - case eXStdString: - setInVector<std::string>(data_, i, buf); + case x_stdstring: + set_invector_<std::string>(data_, i, buf); + break; + case x_short: + { + short const val = string_to_integer<short>(buf); + set_invector_(data_, i, val); + } break; - case eXShort: + case x_integer: { - long val = strtol(buf, NULL, 10); - setInVector<short>(data_, i, static_cast<short>(val)); + int const val = string_to_integer<int>(buf); + set_invector_(data_, i, val); } break; - case eXInteger: + case x_unsigned_long: { - long val = strtol(buf, NULL, 10); - setInVector<int>(data_, i, static_cast<int>(val)); + unsigned long const val = string_to_integer<unsigned long>(buf); + set_invector_(data_, i, val); } break; - case eXUnsignedLong: + case x_long_long: { - long long val = strtoll(buf, NULL, 10); - setInVector<unsigned long>(data_, i, - static_cast<unsigned long>(val)); + long long const val = string_to_integer<long long>(buf); + set_invector_(data_, i, val); } break; - case eXDouble: + case x_double: { - double val = strtod(buf, NULL); - setInVector<double>(data_, i, val); + double const val = string_to_double(buf); + set_invector_(data_, i, val); } break; - case eXStdTm: + case x_stdtm: { // attempt to parse the string and convert to std::tm std::tm t; - parseStdTm(buf, t); + parse_std_tm(buf, t); - setInVector<std::tm>(data_, i, t); + set_invector_(data_, i, t); } break; default: - throw SOCIError("Into element used with non-supported type."); + throw soci_error("Into element used with non-supported type."); } } } @@ -153,54 +155,56 @@ namespace // anonymous { template <typename T> -void resizeVector(void *p, std::size_t sz) +void resizevector_(void * p, std::size_t sz) { - std::vector<T> *v = static_cast<std::vector<T> *>(p); + std::vector<T> * v = static_cast<std::vector<T> *>(p); v->resize(sz); } } // namespace anonymous -void PostgreSQLVectorIntoTypeBackEnd::resize(std::size_t sz) +void postgresql_vector_into_type_backend::resize(std::size_t sz) { switch (type_) { // simple cases - case eXChar: resizeVector<char> (data_, sz); break; - case eXShort: resizeVector<short> (data_, sz); break; - case eXInteger: resizeVector<int> (data_, sz); break; - case eXUnsignedLong: resizeVector<unsigned long>(data_, sz); break; - case eXDouble: resizeVector<double> (data_, sz); break; - case eXStdString: resizeVector<std::string> (data_, sz); break; - case eXStdTm: resizeVector<std::tm> (data_, sz); break; + case x_char: resizevector_<char> (data_, sz); break; + case x_short: resizevector_<short> (data_, sz); break; + case x_integer: resizevector_<int> (data_, sz); break; + case x_unsigned_long: resizevector_<unsigned long>(data_, sz); break; + case x_long_long: resizevector_<long long> (data_, sz); break; + case x_double: resizevector_<double> (data_, sz); break; + case x_stdstring: resizevector_<std::string> (data_, sz); break; + case x_stdtm: resizevector_<std::tm> (data_, sz); break; default: - throw SOCIError("Into vector element used with non-supported type."); + throw soci_error("Into vector element used with non-supported type."); } } -std::size_t PostgreSQLVectorIntoTypeBackEnd::size() +std::size_t postgresql_vector_into_type_backend::size() { std::size_t sz = 0; // dummy initialization to please the compiler switch (type_) { // simple cases - case eXChar: sz = getVectorSize<char> (data_); break; - case eXShort: sz = getVectorSize<short> (data_); break; - case eXInteger: sz = getVectorSize<int> (data_); break; - case eXUnsignedLong: sz = getVectorSize<unsigned long>(data_); break; - case eXDouble: sz = getVectorSize<double> (data_); break; - case eXStdString: sz = getVectorSize<std::string> (data_); break; - case eXStdTm: sz = getVectorSize<std::tm> (data_); break; + case x_char: sz = get_vector_size<char> (data_); break; + case x_short: sz = get_vector_size<short> (data_); break; + case x_integer: sz = get_vector_size<int> (data_); break; + case x_unsigned_long: sz = get_vector_size<unsigned long>(data_); break; + case x_long_long: sz = get_vector_size<long long> (data_); break; + case x_double: sz = get_vector_size<double> (data_); break; + case x_stdstring: sz = get_vector_size<std::string> (data_); break; + case x_stdtm: sz = get_vector_size<std::tm> (data_); break; default: - throw SOCIError("Into vector element used with non-supported type."); + throw soci_error("Into vector element used with non-supported type."); } return sz; } -void PostgreSQLVectorIntoTypeBackEnd::cleanUp() +void postgresql_vector_into_type_backend::clean_up() { // nothing to do here } diff --git a/src/backends/postgresql/vector-use-type.cpp b/src/backends/postgresql/vector-use-type.cpp index ed26113b..4a32a5e8 100644 --- a/src/backends/postgresql/vector-use-type.cpp +++ b/src/backends/postgresql/vector-use-type.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,7 +8,6 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" #include "common.h" -#include <soci.h> #include <libpq/libpq-fs.h> // libpq #include <cctype> #include <cstdio> @@ -24,40 +23,38 @@ #ifdef _MSC_VER #pragma warning(disable:4355 4996) #define snprintf _snprintf -#else -using std::snprintf; #endif -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::PostgreSQL; +using namespace soci; +using namespace soci::details; +using namespace soci::details::postgresql; -void PostgreSQLVectorUseTypeBackEnd::bindByPos(int &position, - void *data, eExchangeType type) +void postgresql_vector_use_type_backend::bind_by_pos(int & position, + void * data, exchange_type type) { data_ = data; type_ = type; position_ = position++; } -void PostgreSQLVectorUseTypeBackEnd::bindByName( - std::string const &name, void *data, eExchangeType type) +void postgresql_vector_use_type_backend::bind_by_name( + std::string const & name, void * data, exchange_type type) { data_ = data; type_ = type; name_ = name; } -void PostgreSQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) +void postgresql_vector_use_type_backend::pre_use(indicator const * ind) { std::size_t const vsize = size(); for (size_t i = 0; i != vsize; ++i) { - char *buf; + char * buf; - // the data in vector can be either eOK or eNull - if (ind != NULL && ind[i] == eNull) + // the data in vector can be either i_ok or i_null + if (ind != NULL && ind[i] == i_null) { buf = NULL; } @@ -66,32 +63,32 @@ void PostgreSQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) // allocate and fill the buffer with text-formatted client data switch (type_) { - case eXChar: + case x_char: { - std::vector<char> *pv + std::vector<char> * pv = static_cast<std::vector<char> *>(data_); - std::vector<char> &v = *pv; + std::vector<char> & v = *pv; buf = new char[2]; buf[0] = v[i]; buf[1] = '\0'; } break; - case eXStdString: + case x_stdstring: { - std::vector<std::string> *pv + std::vector<std::string> * pv = static_cast<std::vector<std::string> *>(data_); - std::vector<std::string> &v = *pv; + std::vector<std::string> & v = *pv; buf = new char[v[i].size() + 1]; std::strcpy(buf, v[i].c_str()); } break; - case eXShort: + case x_short: { - std::vector<short> *pv + std::vector<short> * pv = static_cast<std::vector<short> *>(data_); - std::vector<short> &v = *pv; + std::vector<short> & v = *pv; std::size_t const bufSize = std::numeric_limits<short>::digits10 + 3; @@ -99,11 +96,11 @@ void PostgreSQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf, bufSize, "%d", static_cast<int>(v[i])); } break; - case eXInteger: + case x_integer: { - std::vector<int> *pv + std::vector<int> * pv = static_cast<std::vector<int> *>(data_); - std::vector<int> &v = *pv; + std::vector<int> & v = *pv; std::size_t const bufSize = std::numeric_limits<int>::digits10 + 3; @@ -111,11 +108,11 @@ void PostgreSQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf, bufSize, "%d", v[i]); } break; - case eXUnsignedLong: + case x_unsigned_long: { - std::vector<unsigned long> *pv + std::vector<unsigned long> * pv = static_cast<std::vector<unsigned long> *>(data_); - std::vector<unsigned long> &v = *pv; + std::vector<unsigned long> & v = *pv; std::size_t const bufSize = std::numeric_limits<unsigned long>::digits10 + 2; @@ -123,13 +120,25 @@ void PostgreSQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf, bufSize, "%lu", v[i]); } break; - case eXDouble: + case x_long_long: + { + std::vector<long long> * pv + = static_cast<std::vector<long long> *>(data_); + std::vector<long long> & v = *pv; + + std::size_t const bufSize + = std::numeric_limits<long long>::digits10 + 3; + buf = new char[bufSize]; + snprintf(buf, bufSize, "%lld", v[i]); + } + break; + case x_double: { // no need to overengineer it (KISS)... - std::vector<double> *pv + std::vector<double> * pv = static_cast<std::vector<double> *>(data_); - std::vector<double> &v = *pv; + std::vector<double> & v = *pv; std::size_t const bufSize = 100; buf = new char[bufSize]; @@ -137,11 +146,11 @@ void PostgreSQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) snprintf(buf, bufSize, "%.20g", v[i]); } break; - case eXStdTm: + case x_stdtm: { - std::vector<std::tm> *pv + std::vector<std::tm> * pv = static_cast<std::vector<std::tm> *>(data_); - std::vector<std::tm> &v = *pv; + std::vector<std::tm> & v = *pv; std::size_t const bufSize = 20; buf = new char[bufSize]; @@ -153,7 +162,7 @@ void PostgreSQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) break; default: - throw SOCIError( + throw soci_error( "Use vector element used with non-supported type."); } } @@ -173,28 +182,29 @@ void PostgreSQLVectorUseTypeBackEnd::preUse(eIndicator const *ind) } } -std::size_t PostgreSQLVectorUseTypeBackEnd::size() +std::size_t postgresql_vector_use_type_backend::size() { std::size_t sz = 0; // dummy initialization to please the compiler switch (type_) { // simple cases - case eXChar: sz = getVectorSize<char> (data_); break; - case eXShort: sz = getVectorSize<short> (data_); break; - case eXInteger: sz = getVectorSize<int> (data_); break; - case eXUnsignedLong: sz = getVectorSize<unsigned long>(data_); break; - case eXDouble: sz = getVectorSize<double> (data_); break; - case eXStdString: sz = getVectorSize<std::string> (data_); break; - case eXStdTm: sz = getVectorSize<std::tm> (data_); break; + case x_char: sz = get_vector_size<char> (data_); break; + case x_short: sz = get_vector_size<short> (data_); break; + case x_integer: sz = get_vector_size<int> (data_); break; + case x_unsigned_long: sz = get_vector_size<unsigned long>(data_); break; + case x_long_long: sz = get_vector_size<long long> (data_); break; + case x_double: sz = get_vector_size<double> (data_); break; + case x_stdstring: sz = get_vector_size<std::string> (data_); break; + case x_stdtm: sz = get_vector_size<std::tm> (data_); break; default: - throw SOCIError("Use vector element used with non-supported type."); + throw soci_error("Use vector element used with non-supported type."); } return sz; } -void PostgreSQLVectorUseTypeBackEnd::cleanUp() +void postgresql_vector_use_type_backend::clean_up() { std::size_t const bsize = buffers_.size(); for (std::size_t i = 0; i != bsize; ++i) diff --git a/src/backends/sqlite3/Makefile.am b/src/backends/sqlite3/Makefile.am deleted file mode 100644 index 63630dba..00000000 --- a/src/backends/sqlite3/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:32 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @SQLITE3_CFLAGS@ -AM_LDFLAGS = @SQLITE3_LDFLAGS@ - -lib_LTLIBRARIES = \ - lib@SOCI_SQLITE3_LIBRARY_NAME@.la - -lib@SOCI_SQLITE3_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_SQLITE3_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - common.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_sqlite3dir = $(includedir)/soci/sqlite3 - -soci_sqlite3_HEADERS = \ - common.h \ - soci-sqlite3.h - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/sqlite3/Makefile.basic b/src/backends/sqlite3/Makefile.basic deleted file mode 100644 index 8eef559d..00000000 --- a/src/backends/sqlite3/Makefile.basic +++ /dev/null @@ -1,95 +0,0 @@ -# The following variable is specific to this backend and its correct -# values might depend on your environment - feel free to set it accordingly. - -SQLITE3INCLUDEDIR = - -# The rest of the Makefile is indepentent of the target environment. - -COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -CXXFLAGSSO = ${CXXFLAGS} -fPIC -INCLUDEDIRS = -I../../core ${SQLITE3INCLUDEDIR} - - -OBJECTS = blob.o factory.o row-id.o session.o standard-into-type.o \ - standard-use-type.o statement.o vector-into-type.o vector-use-type.o \ - common.o - -OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ - standard-into-type-s.o standard-use-type-s.o statement-s.o \ - vector-into-type-s.o vector-use-type-s.o common-s.o - - -libsoci-sqlite3.a : ${OBJECTS} - ar rv $@ $? - rm *.o - - -blob.o : blob.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -common.o : common.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -factory.o : factory.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -row-id.o : row-id.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -session.o : session.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -standard-into-type.o : standard-into-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -standard-use-type.o : standard-use-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -statement.o : statement.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -vector-into-type.o : vector-into-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - -vector-use-type.o : vector-use-type.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} - - -shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci-sqlite3.so ${OBJECTSSO} - rm *.o - -blob-s.o : blob.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -common-s.o : common.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -factory-s.o : factory.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -row-id-s.o : row-id.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -session-s.o : session.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -standard-into-type-s.o : standard-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -standard-use-type-s.o : standard-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -statement-s.o : statement.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -vector-into-type-s.o : vector-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - -vector-use-type-s.o : vector-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} - - -clean : - rm -f libsoci-sqlite3.a libsoci-sqlite3.so diff --git a/src/backends/sqlite3/Makefile.in b/src/backends/sqlite3/Makefile.in deleted file mode 100644 index 15a7047e..00000000 --- a/src/backends/sqlite3/Makefile.in +++ /dev/null @@ -1,561 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/backends/sqlite3 -DIST_COMMON = $(soci_sqlite3_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soci_sqlite3dir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -lib@SOCI_SQLITE3_LIBRARY_NAME@_la_LIBADD = -am_lib@SOCI_SQLITE3_LIBRARY_NAME@_la_OBJECTS = blob.lo common.lo \ - factory.lo row-id.lo session.lo standard-into-type.lo \ - standard-use-type.lo statement.lo vector-into-type.lo \ - vector-use-type.lo -lib@SOCI_SQLITE3_LIBRARY_NAME@_la_OBJECTS = \ - $(am_lib@SOCI_SQLITE3_LIBRARY_NAME@_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib@SOCI_SQLITE3_LIBRARY_NAME@_la_SOURCES) -DIST_SOURCES = $(lib@SOCI_SQLITE3_LIBRARY_NAME@_la_SOURCES) -soci_sqlite3HEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(soci_sqlite3_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.3 2006/11/27 09:59:32 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = -I$(top_srcdir)/src/core -AM_CXXFLAGS = -fPIC -AM_CPPFLAGS = @SQLITE3_CFLAGS@ -AM_LDFLAGS = @SQLITE3_LDFLAGS@ -lib_LTLIBRARIES = \ - lib@SOCI_SQLITE3_LIBRARY_NAME@.la - -lib@SOCI_SQLITE3_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_SQLITE3_LIBRARY_NAME@_la_SOURCES = \ - blob.cpp \ - common.cpp \ - factory.cpp \ - row-id.cpp \ - session.cpp \ - standard-into-type.cpp \ - standard-use-type.cpp \ - statement.cpp \ - vector-into-type.cpp \ - vector-use-type.cpp - -soci_sqlite3dir = $(includedir)/soci/sqlite3 -soci_sqlite3_HEADERS = \ - common.h \ - soci-sqlite3.h - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/sqlite3/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/sqlite3/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -lib@SOCI_SQLITE3_LIBRARY_NAME@.la: $(lib@SOCI_SQLITE3_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_SQLITE3_LIBRARY_NAME@_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(lib@SOCI_SQLITE3_LIBRARY_NAME@_la_LDFLAGS) $(lib@SOCI_SQLITE3_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_SQLITE3_LIBRARY_NAME@_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blob.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/row-id.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standard-use-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-into-type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-use-type.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-soci_sqlite3HEADERS: $(soci_sqlite3_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(soci_sqlite3dir)" || $(mkdir_p) "$(DESTDIR)$(soci_sqlite3dir)" - @list='$(soci_sqlite3_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(soci_sqlite3HEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(soci_sqlite3dir)/$$f'"; \ - $(soci_sqlite3HEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(soci_sqlite3dir)/$$f"; \ - done - -uninstall-soci_sqlite3HEADERS: - @$(NORMAL_UNINSTALL) - @list='$(soci_sqlite3_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(soci_sqlite3dir)/$$f'"; \ - rm -f "$(DESTDIR)$(soci_sqlite3dir)/$$f"; \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soci_sqlite3dir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-soci_sqlite3HEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-soci_sqlite3HEADERS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-soci_sqlite3HEADERS \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-libLTLIBRARIES uninstall-soci_sqlite3HEADERS - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/sqlite3/blob.cpp b/src/backends/sqlite3/blob.cpp deleted file mode 100644 index 1f2d6c2a..00000000 --- a/src/backends/sqlite3/blob.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "soci.h" -#include "soci-sqlite3.h" - -using namespace SOCI; - -Sqlite3BLOBBackEnd::Sqlite3BLOBBackEnd(Sqlite3SessionBackEnd &session) - : session_(session) -{ - throw SOCIError("BLOBs are not supported."); -} - -Sqlite3BLOBBackEnd::~Sqlite3BLOBBackEnd() -{ - throw SOCIError("BLOBs are not supported."); -} - -std::size_t Sqlite3BLOBBackEnd::getLen() -{ - throw SOCIError("BLOBs are not supported."); -} - -std::size_t Sqlite3BLOBBackEnd::read( - std::size_t /* offset */, char * /* buf */, std::size_t /* toRead */) -{ - throw SOCIError("BLOBs are not supported."); -} - -std::size_t Sqlite3BLOBBackEnd::write( - std::size_t /* offset */, char const * /* buf */, - std::size_t /* toWrite */) -{ - throw SOCIError("BLOBs are not supported."); -} - -std::size_t Sqlite3BLOBBackEnd::append( - char const * /* buf */, std::size_t /* toWrite */) -{ - throw SOCIError("BLOBs are not supported."); -} - -void Sqlite3BLOBBackEnd::trim(std::size_t /* newLen */) -{ - throw SOCIError("BLOBs are not supported."); -} - diff --git a/src/backends/sqlite3/common.cpp b/src/backends/sqlite3/common.cpp deleted file mode 100644 index 31b9527c..00000000 --- a/src/backends/sqlite3/common.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "common.h" -#include "soci-backend.h" -#include <cstdlib> -#include <ctime> - - -namespace // anonymous -{ - -// helper function for parsing decimal data (for std::tm) -long parse10(char const *&p1, char *&p2, char *msg) -{ - long v = std::strtol(p1, &p2, 10); - if (p2 != p1) - { - p1 = p2 + 1; - return v; - } - else - { - throw SOCI::SOCIError(msg); - } -} - -} // namespace anonymous - - -void SOCI::details::Sqlite3::parseStdTm(char const *buf, std::tm &t) -{ - char const *p1 = buf; - char *p2; - long year, month, day; - long hour = 0, minute = 0, second = 0; - - char *errMsg = "Cannot convert data to std::tm."; - - year = parse10(p1, p2, errMsg); - month = parse10(p1, p2, errMsg); - day = parse10(p1, p2, errMsg); - - if (*p2 != '\0') - { - // there is also the time of day available - hour = parse10(p1, p2, errMsg); - minute = parse10(p1, p2, errMsg); - second = parse10(p1, p2, errMsg); - } - - t.tm_isdst = -1; - t.tm_year = year - 1900; - t.tm_mon = month - 1; - t.tm_mday = day; - t.tm_hour = hour; - t.tm_min = minute; - t.tm_sec = second; - - std::mktime(&t); -} diff --git a/src/backends/sqlite3/common.h b/src/backends/sqlite3/common.h deleted file mode 100644 index 1a2d7050..00000000 --- a/src/backends/sqlite3/common.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef SQLITE3_COMMON_H_INCLUDED -#define SQLITE3_COMMON_H_INCLUDED - -#include <vector> - -namespace SOCI { - -namespace details { - -namespace Sqlite3 { - -// helper function for parsing datetime values -void parseStdTm(char const *buf, std::tm &t); - -// helper for vector operations -template <typename T> -std::size_t getVectorSize(void *p) -{ - std::vector<T> *v = static_cast<std::vector<T> *>(p); - return v->size(); -} - -template <typename T> -void resizeVector(void *p, std::size_t sz) -{ - std::vector<T> *v = static_cast<std::vector<T> *>(p); - v->resize(sz); -} - -} // namespace Sqlite3 - -} // namespace details - -} // namespace SOCI - -#endif // SQLITE3_COMMON_H_INCLUDED - diff --git a/src/backends/sqlite3/factory.cpp b/src/backends/sqlite3/factory.cpp deleted file mode 100644 index a539294a..00000000 --- a/src/backends/sqlite3/factory.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_SQLITE3_SOURCE -#include "soci.h" -#include "soci-sqlite3.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - - -// concrete factory for Empty concrete strategies -Sqlite3SessionBackEnd * Sqlite3BackEndFactory::makeSession( - std::string const &connectString) const -{ - return new Sqlite3SessionBackEnd(connectString); -} - -SOCI_SQLITE3_DECL Sqlite3BackEndFactory const SOCI::sqlite3; diff --git a/src/backends/sqlite3/row-id.cpp b/src/backends/sqlite3/row-id.cpp deleted file mode 100644 index f5227ced..00000000 --- a/src/backends/sqlite3/row-id.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - - -#include "soci.h" -#include "soci-sqlite3.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - -Sqlite3RowIDBackEnd::Sqlite3RowIDBackEnd( - Sqlite3SessionBackEnd & /* session */) -{ - // ... -} - -Sqlite3RowIDBackEnd::~Sqlite3RowIDBackEnd() -{ - // ... -} diff --git a/src/backends/sqlite3/session.cpp b/src/backends/sqlite3/session.cpp deleted file mode 100644 index 2f27eecf..00000000 --- a/src/backends/sqlite3/session.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - - -#include "soci.h" -#include "soci-sqlite3.h" - -#include <sstream> - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; -using namespace sqlite_api; - -namespace // anonymous -{ - -// helper function for hardcoded queries -void hardExec(sqlite_api::sqlite3 *conn, char const *query, char const *errMsg) -{ - char *zErrMsg = 0; - int res = sqlite3_exec(conn, query, 0, 0, &zErrMsg); - if (res != SQLITE_OK) - { - std::ostringstream ss; - ss << errMsg << " " - << zErrMsg; - - sqlite3_free(zErrMsg); - - throw SOCIError(ss.str()); - } -} - -} // namespace anonymous - - -Sqlite3SessionBackEnd::Sqlite3SessionBackEnd( - std::string const & connectString) -{ - int res; - res = sqlite3_open(connectString.c_str(), &conn_); - if (res != SQLITE_OK) - { - const char *zErrMsg = sqlite3_errmsg(conn_); - - std::ostringstream ss; - ss << "Cannot establish connection to the database. " - << zErrMsg; - - throw SOCIError(ss.str()); - } -} - -Sqlite3SessionBackEnd::~Sqlite3SessionBackEnd() -{ - cleanUp(); -} - -void Sqlite3SessionBackEnd::begin() -{ - hardExec(conn_, "BEGIN", "Cannot begin transaction."); -} - -void Sqlite3SessionBackEnd::commit() -{ - hardExec(conn_, "COMMIT", "Cannot commit transaction."); -} - -void Sqlite3SessionBackEnd::rollback() -{ - hardExec(conn_, "ROLLBACK", "Cannot rollback transaction."); -} - -void Sqlite3SessionBackEnd::cleanUp() -{ - sqlite3_close(conn_); -} - -Sqlite3StatementBackEnd * Sqlite3SessionBackEnd::makeStatementBackEnd() -{ - return new Sqlite3StatementBackEnd(*this); -} - -Sqlite3RowIDBackEnd * Sqlite3SessionBackEnd::makeRowIDBackEnd() -{ - return new Sqlite3RowIDBackEnd(*this); -} - -Sqlite3BLOBBackEnd * Sqlite3SessionBackEnd::makeBLOBBackEnd() -{ - return new Sqlite3BLOBBackEnd(*this); -} diff --git a/src/backends/sqlite3/soci-sqlite3.h b/src/backends/sqlite3/soci-sqlite3.h deleted file mode 100644 index 3ccba92f..00000000 --- a/src/backends/sqlite3/soci-sqlite3.h +++ /dev/null @@ -1,257 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef SOCI_SQLITE3_H_INCLUDED -#define SOCI_SQLITE3_H_INCLUDED - -#ifdef _WIN32 -# ifdef SOCI_DLL -# ifdef SOCI_SQLITE3_SOURCE -# define SOCI_SQLITE3_DECL __declspec(dllexport) -# else -# define SOCI_SQLITE3_DECL __declspec(dllimport) -# endif // SOCI_SQLITE3_SOURCE -# endif // SOCI_DLL -#endif // _WIN32 -// -// If SOCI_SQLITE3_DECL isn't defined yet define it now -#ifndef SOCI_SQLITE3_DECL -# define SOCI_SQLITE3_DECL -#endif - -#include "soci-backend.h" - -// Disable flood of nonsense warnings generated for SQLite -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4510 4610) -#endif - -namespace sqlite_api -{ -#include <sqlite3.h> -} - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - - -namespace SOCI -{ - -struct Sqlite3StatementBackEnd; -struct Sqlite3StandardIntoTypeBackEnd : details::StandardIntoTypeBackEnd -{ - Sqlite3StandardIntoTypeBackEnd(Sqlite3StatementBackEnd &st) - : statement_(st) {} - - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); - - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind); - - virtual void cleanUp(); - - Sqlite3StatementBackEnd &statement_; - - void *data_; - details::eExchangeType type_; - int position_; -}; - -struct Sqlite3VectorIntoTypeBackEnd : details::VectorIntoTypeBackEnd -{ - Sqlite3VectorIntoTypeBackEnd(Sqlite3StatementBackEnd &st) - : statement_(st) {} - - virtual void defineByPos(int &position, - void *data, details::eExchangeType type); - - virtual void preFetch(); - virtual void postFetch(bool gotData, eIndicator *ind); - - virtual void resize(std::size_t sz); - virtual std::size_t size(); - - virtual void cleanUp(); - - Sqlite3StatementBackEnd &statement_; - - void *data_; - details::eExchangeType type_; - int position_; -}; - -struct Sqlite3StandardUseTypeBackEnd : details::StandardUseTypeBackEnd -{ - Sqlite3StandardUseTypeBackEnd(Sqlite3StatementBackEnd &st) - : statement_(st), buf_(0) {} - - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); - - virtual void preUse(eIndicator const *ind); - virtual void postUse(bool gotData, eIndicator *ind); - - virtual void cleanUp(); - - Sqlite3StatementBackEnd &statement_; - - void *data_; - details::eExchangeType type_; - int position_; - std::string name_; - char *buf_; -}; - -struct Sqlite3VectorUseTypeBackEnd : details::VectorUseTypeBackEnd -{ - Sqlite3VectorUseTypeBackEnd(Sqlite3StatementBackEnd &st) - : statement_(st) {} - - virtual void bindByPos(int &position, - void *data, details::eExchangeType type); - virtual void bindByName(std::string const &name, - void *data, details::eExchangeType type); - - virtual void preUse(eIndicator const *ind); - - virtual std::size_t size(); - - virtual void cleanUp(); - - Sqlite3StatementBackEnd &statement_; - - void *data_; - details::eExchangeType type_; - int position_; - std::string name_; -}; - -struct Sqlite3Column -{ - std::string data_; - bool isNull_; -}; - -typedef std::vector<Sqlite3Column> Sqlite3Row; -typedef std::vector<Sqlite3Row> Sqlite3RecordSet; - -struct Sqlite3SessionBackEnd; -struct Sqlite3StatementBackEnd : details::StatementBackEnd -{ - Sqlite3StatementBackEnd(Sqlite3SessionBackEnd &session); - - virtual void alloc(); - virtual void cleanUp(); - virtual void prepare(std::string const &query, - details::eStatementType eType); - void resetIfNeeded(); - - virtual execFetchResult execute(int number); - virtual execFetchResult fetch(int number); - - virtual int getNumberOfRows(); - - virtual std::string rewriteForProcedureCall(std::string const &query); - - virtual int prepareForDescribe(); - virtual void describeColumn(int colNum, eDataType &dtype, - std::string &columnName); - - virtual Sqlite3StandardIntoTypeBackEnd * makeIntoTypeBackEnd(); - virtual Sqlite3StandardUseTypeBackEnd * makeUseTypeBackEnd(); - virtual Sqlite3VectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd(); - virtual Sqlite3VectorUseTypeBackEnd * makeVectorUseTypeBackEnd(); - - Sqlite3SessionBackEnd &session_; - sqlite_api::sqlite3_stmt *stmt_; - Sqlite3RecordSet dataCache_; - Sqlite3RecordSet useData_; - bool databaseReady_; - bool boundByName_; - bool boundByPos_; - -private: - execFetchResult loadRS(int totalRows); - execFetchResult loadOne(); - execFetchResult bindAndExecute(int number); -}; - -struct Sqlite3RowIDBackEnd : details::RowIDBackEnd -{ - Sqlite3RowIDBackEnd(Sqlite3SessionBackEnd &session); - - ~Sqlite3RowIDBackEnd(); - - unsigned long value_; -}; - -struct Sqlite3BLOBBackEnd : details::BLOBBackEnd -{ - Sqlite3BLOBBackEnd(Sqlite3SessionBackEnd &session); - - ~Sqlite3BLOBBackEnd(); - - void setData(const char *tableName, const char *columnName, - const char *buf, size_t len); - - virtual std::size_t getLen(); - virtual std::size_t read(std::size_t offset, char *buf, - std::size_t toRead); - virtual std::size_t write(std::size_t offset, char const *buf, - std::size_t toWrite); - virtual std::size_t append(char const *buf, std::size_t toWrite); - virtual void trim(std::size_t newLen); - - Sqlite3SessionBackEnd &session_; -private: - - void updateBLOB(); - - std::string tableName_; - std::string columnName_; - char *buf_; - size_t len_; -}; - -struct Sqlite3SessionBackEnd : details::SessionBackEnd -{ - Sqlite3SessionBackEnd(std::string const &connectString); - - ~Sqlite3SessionBackEnd(); - - virtual void begin(); - virtual void commit(); - virtual void rollback(); - - void cleanUp(); - - virtual Sqlite3StatementBackEnd * makeStatementBackEnd(); - virtual Sqlite3RowIDBackEnd * makeRowIDBackEnd(); - virtual Sqlite3BLOBBackEnd * makeBLOBBackEnd(); - - sqlite_api::sqlite3 *conn_; -}; - -struct Sqlite3BackEndFactory : BackEndFactory -{ - virtual Sqlite3SessionBackEnd * makeSession( - std::string const &connectString) const; -}; - -SOCI_SQLITE3_DECL extern Sqlite3BackEndFactory const sqlite3; - -} // namespace SOCI - -#endif // SOCI_SQLITE3_H_INCLUDED - diff --git a/src/backends/sqlite3/standard-into-type.cpp b/src/backends/sqlite3/standard-into-type.cpp deleted file mode 100644 index 8d356f69..00000000 --- a/src/backends/sqlite3/standard-into-type.cpp +++ /dev/null @@ -1,176 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - - -#include "soci.h" -#include "soci-sqlite3.h" - -#include "common.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#define strtoll(s, p, b) static_cast<long long>(_strtoi64(s, p, b)) -#endif - -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Sqlite3; - -void Sqlite3StandardIntoTypeBackEnd::defineByPos(int & position, void * data - , eExchangeType type) -{ - data_ = data; - type_ = type; - position_ = position++; -} - -void Sqlite3StandardIntoTypeBackEnd::preFetch() -{ - // ... -} - -void Sqlite3StandardIntoTypeBackEnd::postFetch(bool gotData, - bool calledFromFetch, - eIndicator * ind) -{ - if (calledFromFetch == true && gotData == false) - { - // this is a normal end-of-rowset condition, - // no need to do anything (fetch() will return false) - return; - } - - // sqlite columns start at 0 - int pos = position_ - 1; - - if (gotData) - { - // first, deal with indicators - if (sqlite3_column_type(statement_.stmt_, pos) == SQLITE_NULL) - { - if (ind == NULL) - { - throw SOCIError( - "Null value fetched and no indicator defined."); - } - - *ind = eNull; - return; - } - else - { - if (ind != NULL) - { - *ind = eOK; - } - } - - const char *buf = - reinterpret_cast<const char*>(sqlite3_column_text( - statement_.stmt_, - pos)); - - if (!buf) - buf = ""; - - - switch (type_) - { - case eXChar: - { - char *dest = static_cast<char*>(data_); - *dest = *buf; - } - break; - case eXCString: - { - CStringDescriptor *strDescr - = static_cast<CStringDescriptor *>(data_); - - std::strncpy(strDescr->str_, buf, strDescr->bufSize_ - 1); - strDescr->str_[strDescr->bufSize_ - 1] = '\0'; - - if (std::strlen(buf) >= strDescr->bufSize_ && ind != NULL) - { - *ind = eTruncated; - } - } - break; - case eXStdString: - { - std::string *dest = static_cast<std::string *>(data_); - dest->assign(buf); - } - break; - case eXShort: - { - short *dest = static_cast<short*>(data_); - long val = strtol(buf, NULL, 10); - *dest = static_cast<short>(val); - } - break; - case eXInteger: - { - int *dest = static_cast<int*>(data_); - long val = strtol(buf, NULL, 10); - *dest = static_cast<int>(val); - } - break; - case eXUnsignedLong: - { - unsigned long *dest = static_cast<unsigned long *>(data_); - long long val = strtoll(buf, NULL, 10); - *dest = static_cast<unsigned long>(val); - } - break; - case eXDouble: - { - double *dest = static_cast<double*>(data_); - double val = strtod(buf, NULL); - *dest = static_cast<double>(val); - } - break; - case eXStdTm: - { - // attempt to parse the string and convert to std::tm - std::tm *dest = static_cast<std::tm *>(data_); - parseStdTm(buf, *dest); - } - break; - case eXRowID: - { - // RowID is internally identical to unsigned long - - RowID *rid = static_cast<RowID *>(data_); - Sqlite3RowIDBackEnd *rbe - = static_cast<Sqlite3RowIDBackEnd *>( - rid->getBackEnd()); - long long val = strtoll(buf, NULL, 10); - rbe->value_ = static_cast<unsigned long>(val); - } - break; - default: - throw SOCIError("Into element used with non-supported type."); - } - } - else // no data retrieved - { - if (ind != NULL) - { - *ind = eNoData; - } - else - { - throw SOCIError("No data fetched and no indicator defined."); - } - } -} - -void Sqlite3StandardIntoTypeBackEnd::cleanUp() -{ - // ... -} diff --git a/src/backends/sqlite3/standard-use-type.cpp b/src/backends/sqlite3/standard-use-type.cpp deleted file mode 100644 index d156a7d4..00000000 --- a/src/backends/sqlite3/standard-use-type.cpp +++ /dev/null @@ -1,198 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - - -#include "soci.h" -#include "soci-sqlite3.h" -#include <limits> - -#ifdef _MSC_VER -#pragma warning(disable:4355 4996) -#define snprintf _snprintf -#endif - -using namespace SOCI; -using namespace SOCI::details; - -void Sqlite3StandardUseTypeBackEnd::bindByPos(int & position, void * data, - eExchangeType type) -{ - if (statement_.boundByName_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - data_ = data; - type_ = type; - position_ = position++; - - statement_.boundByPos_ = true; -} - -void Sqlite3StandardUseTypeBackEnd::bindByName(std::string const & name, - void * data, - eExchangeType type) -{ - if (statement_.boundByPos_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - data_ = data; - type_ = type; - name_ = ":" + name; - - statement_.resetIfNeeded(); - position_ = sqlite3_bind_parameter_index(statement_.stmt_, name_.c_str()); - - if (0 == position_) - { - std::ostringstream ss; - ss << "Cannot bind to (by name) " << name_; - throw SOCIError(ss.str()); - } - statement_.boundByName_ = true; -} - -void Sqlite3StandardUseTypeBackEnd::preUse(eIndicator const * ind) -{ - statement_.useData_.resize(1); - int pos = position_ - 1; - - if (statement_.useData_[0].size() < static_cast<std::size_t>(position_)) - statement_.useData_[0].resize(position_); - - if (ind != NULL && *ind == eNull) - { - statement_.useData_[0][pos].isNull_ = true; - statement_.useData_[0][pos].data_ = ""; - } - else - { - // allocate and fill the buffer with text-formatted client data - switch (type_) - { - case eXChar: - { - buf_ = new char[2]; - buf_[0] = *static_cast<char*>(data_); - buf_[1] = '\0'; - } - break; - case eXCString: - { - CStringDescriptor *strDescr - = static_cast<CStringDescriptor *>(data_); - - std::size_t len = std::strlen(strDescr->str_); - buf_ = new char[len + 1]; - std::strcpy(buf_, strDescr->str_); - } - break; - case eXStdString: - { - std::string *s = static_cast<std::string *>(data_); - buf_ = new char[s->size() + 1]; - std::strcpy(buf_, s->c_str()); - } - break; - case eXShort: - { - std::size_t const bufSize - = std::numeric_limits<short>::digits10 + 3; - buf_ = new char[bufSize]; - snprintf(buf_, bufSize, "%d", - static_cast<int>(*static_cast<short*>(data_))); - } - break; - case eXInteger: - { - std::size_t const bufSize - = std::numeric_limits<int>::digits10 + 3; - buf_ = new char[bufSize]; - snprintf(buf_, bufSize, "%d", - *static_cast<int*>(data_)); - } - break; - case eXUnsignedLong: - { - std::size_t const bufSize - = std::numeric_limits<unsigned long>::digits10 + 2; - buf_ = new char[bufSize]; - snprintf(buf_, bufSize, "%lu", - *static_cast<unsigned long*>(data_)); - } - break; - case eXDouble: - { - // no need to overengineer it (KISS)... - - std::size_t const bufSize = 100; - buf_ = new char[bufSize]; - - snprintf(buf_, bufSize, "%.20g", - *static_cast<double*>(data_)); - } - break; - case eXStdTm: - { - std::size_t const bufSize = 20; - buf_ = new char[bufSize]; - - std::tm *t = static_cast<std::tm *>(data_); - snprintf(buf_, bufSize, "%d-%02d-%02d %02d:%02d:%02d", - t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec); - } - break; - case eXRowID: - { - // RowID is internally identical to unsigned long - - RowID *rid = static_cast<RowID *>(data_); - Sqlite3RowIDBackEnd *rbe - = static_cast<Sqlite3RowIDBackEnd *>( - rid->getBackEnd()); - - std::size_t const bufSize - = std::numeric_limits<unsigned long>::digits10 + 2; - buf_ = new char[bufSize]; - - snprintf(buf_, bufSize, "%lu", rbe->value_); - } - break; - - default: - throw SOCIError("Use element used with non-supported type."); - } - - statement_.useData_[0][pos].isNull_ = false; - statement_.useData_[0][pos].data_ = buf_; - } -} - -void Sqlite3StandardUseTypeBackEnd::postUse( - bool /* gotData */, eIndicator * /* ind */) -{ - // TODO: if sqlite3 allows to *get* data via this channel, - // write it back to client buffers (variable) - - // clean up the working buffer, it might be allocated anew in - // the next run of preUse - cleanUp(); -} - -void Sqlite3StandardUseTypeBackEnd::cleanUp() -{ - if (buf_ != NULL) - { - delete [] buf_; - buf_ = NULL; - } -} diff --git a/src/backends/sqlite3/statement.cpp b/src/backends/sqlite3/statement.cpp deleted file mode 100644 index 39611525..00000000 --- a/src/backends/sqlite3/statement.cpp +++ /dev/null @@ -1,357 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - - -#include "soci.h" -#include "soci-sqlite3.h" - -#include <sstream> -#include <algorithm> - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - -Sqlite3StatementBackEnd::Sqlite3StatementBackEnd( - Sqlite3SessionBackEnd &session) - : session_(session), stmt_(0), dataCache_(), useData_(0), - databaseReady_(false), boundByName_(false), boundByPos_(false) -{ -} - -void Sqlite3StatementBackEnd::alloc() -{ - // ... -} - -void Sqlite3StatementBackEnd::cleanUp() -{ - if (stmt_) - { - sqlite3_finalize(stmt_); - stmt_ = 0; - databaseReady_ = false; - } -} - -void Sqlite3StatementBackEnd::prepare(std::string const & query, - eStatementType /* eType */) -{ - cleanUp(); - - const char *tail; // unused; - int res = sqlite3_prepare(session_.conn_, - query.c_str(), - static_cast<int>(query.size()), - &stmt_, - &tail); - if (res != SQLITE_OK) - { - const char *zErrMsg = sqlite3_errmsg(session_.conn_); - - std::ostringstream ss; - ss << "Sqlite3StatementBackEnd::prepare: " - << zErrMsg; - throw SOCIError(ss.str()); - } - databaseReady_ = true; -} - -// sqlite3_reset needs to be called before a prepared statment can -// be executed a second time. -void Sqlite3StatementBackEnd::resetIfNeeded() -{ - if (stmt_ && !databaseReady_) - { - int res = sqlite3_reset(stmt_); - if (SQLITE_OK == res) - databaseReady_ = true; - } -} - -// This is used by bulk operations -StatementBackEnd::execFetchResult -Sqlite3StatementBackEnd::loadRS(int totalRows) -{ - StatementBackEnd::execFetchResult retVal = eSuccess; - int numCols = -1; - - // make the vector big enough to hold the data we need - dataCache_.resize(totalRows); - - int i = 0; - for (i = 0; i < totalRows; ++i) - { - int res = sqlite3_step(stmt_); - - if (SQLITE_DONE == res) - { - databaseReady_ = false; - retVal = eNoData; - - break; - } - else if (SQLITE_ROW == res) - { - // only need to set the number of columns once - if (-1 == numCols) - { - numCols = sqlite3_column_count(stmt_); - - for (Sqlite3RecordSet::iterator it = dataCache_.begin(); - it != dataCache_.end(); ++it) - { - (*it).resize(numCols); - } - } - for (int c = 0; c < numCols; ++c) - { - const char *buf = - reinterpret_cast<const char*>(sqlite3_column_text( - stmt_, - c)); - bool isNull = false; - - if (0 == buf) - { - isNull = true; - buf = ""; - } - - dataCache_[i][c].data_ = buf; - dataCache_[i][c].isNull_ = isNull; - } - } - else - { - cleanUp(); - - const char *zErrMsg = sqlite3_errmsg(session_.conn_); - - std::ostringstream ss; - ss << "Sqlite3StatementBackEnd::loadRS: " - << zErrMsg; - throw SOCIError(ss.str()); - } - } - - // if we read less than requested then shrink the vector - dataCache_.resize(i); - - return retVal; -} - -// This is used for non-bulk operations -StatementBackEnd::execFetchResult -Sqlite3StatementBackEnd::loadOne() -{ - StatementBackEnd::execFetchResult retVal = eSuccess; - - int res = sqlite3_step(stmt_); - - if (SQLITE_DONE == res) - { - databaseReady_ = false; - retVal = eNoData; - } - else if (SQLITE_ROW == res) - { - } - else - { - cleanUp(); - - const char *zErrMsg = sqlite3_errmsg(session_.conn_); - - std::ostringstream ss; - ss << "Sqlite3StatementBackEnd::loadOne: " - << zErrMsg; - throw SOCIError(ss.str()); - } - - return retVal; -} - -// Execute statements once for every row of useData -StatementBackEnd::execFetchResult -Sqlite3StatementBackEnd::bindAndExecute(int number) -{ - StatementBackEnd::execFetchResult retVal = eNoData; - - int rows = static_cast<int>(useData_.size()); - - for (int row = 0; row < rows; ++row) - { - sqlite3_reset(stmt_); - - int totalPositions = static_cast<int>(useData_[0].size()); - for (int pos = 1; pos <= totalPositions; ++pos) - { - int bindRes = SQLITE_OK; - const Sqlite3Column& curCol = useData_[row][pos-1]; - if (curCol.isNull_) - bindRes = sqlite3_bind_null(stmt_, pos); - else - bindRes = sqlite3_bind_text(stmt_, pos, - curCol.data_.c_str(), - static_cast<int>(curCol.data_.length()), - SQLITE_STATIC); - - if (SQLITE_OK != bindRes) - throw SOCIError("Failure to bind on bulk operations"); - } - - // Handle the case where there are both into and use elements - // in the same query and one of the into binds to a vector object. - if (1 == rows && number != rows) - return loadRS(number); - - retVal = loadOne(); //execute each bound line - } - return retVal; -} - -StatementBackEnd::execFetchResult -Sqlite3StatementBackEnd::execute(int number) -{ - if (!stmt_) - throw SOCIError("No sqlite statement created"); - - sqlite3_reset(stmt_); - databaseReady_ = true; - - StatementBackEnd::execFetchResult retVal = eNoData; - - if (!useData_.empty()) - { - retVal = bindAndExecute(number); - } - else - { - if (1 == number) - retVal = loadOne(); - else - retVal = loadRS(number); - } - - return retVal; -} - -StatementBackEnd::execFetchResult -Sqlite3StatementBackEnd::fetch(int number) -{ - return loadRS(number); -} - -int Sqlite3StatementBackEnd::getNumberOfRows() -{ - return static_cast<int>(dataCache_.size()); -} - -std::string Sqlite3StatementBackEnd::rewriteForProcedureCall( - std::string const &query) -{ - return query; -} - -int Sqlite3StatementBackEnd::prepareForDescribe() -{ - return sqlite3_column_count(stmt_); -} - -void Sqlite3StatementBackEnd::describeColumn(int colNum, eDataType & type, - std::string & columnName) -{ - - columnName = sqlite3_column_name(stmt_, colNum-1); - - // This is a hack, but the sqlite3 type system does not - // have a date or time field. Also it does not reliably - // id other data types. It has a tendency to see everything - // as text. sqlite3_column_decltype returns the text that is - // used in the create table statement - bool typeFound = false; - - const char* declType = sqlite3_column_decltype(stmt_, colNum-1); - std::string dt = declType; - - // do all comparisions in lower case - std::transform(dt.begin(), dt.end(), dt.begin(), tolower); - - if (dt.find("time",0) != std::string::npos) - { - type = eDate; - typeFound = true; - } - if (dt.find("date",0) != std::string::npos) - { - type = eDate; - typeFound = true; - } - if (dt.find("int",0) != std::string::npos) - { - type = eInteger; - typeFound = true; - } - if (dt.find("float",0) != std::string::npos) - { - type = eDouble; - typeFound = true; - } - if (dt.find("char",0) != std::string::npos) - { - type = eString; - typeFound = true; - } - - if (typeFound) - return; - - // try to get it from the weak ass type system - - // total hack - execute the statment once to get the column types - // then clear so it can be executed again - sqlite3_step(stmt_); - - int sqlite3_type = sqlite3_column_type(stmt_, colNum-1); - switch (sqlite3_type) - { - case SQLITE_INTEGER: type = eInteger; break; - case SQLITE_FLOAT: type = eDouble; break; - case SQLITE_BLOB: - case SQLITE_TEXT: type = eString; break; - default: type = eString; break; - } - - sqlite3_reset(stmt_); -} - -Sqlite3StandardIntoTypeBackEnd * -Sqlite3StatementBackEnd::makeIntoTypeBackEnd() -{ - return new Sqlite3StandardIntoTypeBackEnd(*this); -} - -Sqlite3StandardUseTypeBackEnd * Sqlite3StatementBackEnd::makeUseTypeBackEnd() -{ - return new Sqlite3StandardUseTypeBackEnd(*this); -} - -Sqlite3VectorIntoTypeBackEnd * -Sqlite3StatementBackEnd::makeVectorIntoTypeBackEnd() -{ - return new Sqlite3VectorIntoTypeBackEnd(*this); -} - -Sqlite3VectorUseTypeBackEnd * -Sqlite3StatementBackEnd::makeVectorUseTypeBackEnd() -{ - return new Sqlite3VectorUseTypeBackEnd(*this); -} diff --git a/src/backends/sqlite3/test/Makefile.am b/src/backends/sqlite3/test/Makefile.am deleted file mode 100644 index 60efc3e6..00000000 --- a/src/backends/sqlite3/test/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:32 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/core/test \ - -I$(top_srcdir)/src/backends/sqlite3 - -AM_CPPFLAGS = @SQLITE3_CFLAGS@ -AM_LDFLAGS = @SQLITE3_LDFLAGS@ - -TEST_CASE = test_sqlite3 -TEST_DB = test_sqlite3.db - -noinst_PROGRAMS = \ - $(TEST_CASE) - -#test_sqlite3_CPPFLAGS = \ -# -DSQLITE_ENABLE_COLUMN_METADATA - -test_sqlite3_SOURCES = \ - test-sqlite3.cpp - -test_sqlite3_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/sqlite3/lib@SOCI_SQLITE3_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic - -check-local: - $(SHELL) -x $(TEST_CASE) $(TEST_DB) - -clean-local: - $(RM) $(TEST_DB) - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/backends/sqlite3/test/Makefile.basic b/src/backends/sqlite3/test/Makefile.basic deleted file mode 100644 index 9f3ff064..00000000 --- a/src/backends/sqlite3/test/Makefile.basic +++ /dev/null @@ -1,22 +0,0 @@ -# The following variable is specific to this backend and its correct -# values might depend on your environment - feel free to set it accordingly. - -SQLITE3INCLUDEDIR = -SQLITE3LIBDIR = -L/usr/lib -SQLITE3LIBS = -lsqlite3 - -# The rest of the Makefile is independent of the target environment. - -COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -INCLUDEDIRS = -I.. -I../../../core -I../../../core/test ${SQLITE3INCLUDEDIR} -LIBDIRS = -L.. -L../../../core ${SQLITE3LIBDIR} -LIBS = -lsoci-core -lsoci-sqlite3 ${SQLITE3LIBS} - - -test-sqlite3 : test-sqlite3.cpp - ${COMPILER} -o $@ $? ${CXXFLAGS} ${INCLUDEDIRS} ${LIBDIRS} ${LIBS} - - -clean : - rm -f test-sqlite3 diff --git a/src/backends/sqlite3/test/Makefile.in b/src/backends/sqlite3/test/Makefile.in deleted file mode 100644 index f39a6a58..00000000 --- a/src/backends/sqlite3/test/Makefile.in +++ /dev/null @@ -1,498 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -noinst_PROGRAMS = $(am__EXEEXT_1) -subdir = src/backends/sqlite3/test -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -am__EXEEXT_1 = test_sqlite3$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) -am_test_sqlite3_OBJECTS = test-sqlite3.$(OBJEXT) -test_sqlite3_OBJECTS = $(am_test_sqlite3_OBJECTS) -test_sqlite3_DEPENDENCIES = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/sqlite3/lib@SOCI_SQLITE3_LIBRARY_NAME@.la -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(test_sqlite3_SOURCES) -DIST_SOURCES = $(test_sqlite3_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:32 mloskot Exp $ -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -INCLUDES = \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/src/core/test \ - -I$(top_srcdir)/src/backends/sqlite3 - -AM_CPPFLAGS = @SQLITE3_CFLAGS@ -AM_LDFLAGS = @SQLITE3_LDFLAGS@ -TEST_CASE = test_sqlite3 -TEST_DB = test_sqlite3.db - -#test_sqlite3_CPPFLAGS = \ -# -DSQLITE_ENABLE_COLUMN_METADATA -test_sqlite3_SOURCES = \ - test-sqlite3.cpp - -test_sqlite3_LDADD = \ - $(top_srcdir)/src/core/lib@SOCI_CORE_LIBRARY_NAME@.la \ - $(top_srcdir)/src/backends/sqlite3/lib@SOCI_SQLITE3_LIBRARY_NAME@.la - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/sqlite3/test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/backends/sqlite3/test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_sqlite3$(EXEEXT): $(test_sqlite3_OBJECTS) $(test_sqlite3_DEPENDENCIES) - @rm -f test_sqlite3$(EXEEXT) - $(CXXLINK) $(test_sqlite3_LDFLAGS) $(test_sqlite3_OBJECTS) $(test_sqlite3_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sqlite3.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-local -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ - clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ - ctags distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic maintainer-clean-local mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am - - -check-local: - $(SHELL) -x $(TEST_CASE) $(TEST_DB) - -clean-local: - $(RM) $(TEST_DB) - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/backends/sqlite3/test/test-sqlite3.cpp b/src/backends/sqlite3/test/test-sqlite3.cpp deleted file mode 100644 index 0a0e6204..00000000 --- a/src/backends/sqlite3/test/test-sqlite3.cpp +++ /dev/null @@ -1,233 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#include "soci.h" -#include "soci-sqlite3.h" -#include "common-tests.h" -#include <iostream> -#include <sstream> -#include <string> -#include <cassert> -#include <cmath> -#include <ctime> - -using namespace SOCI; -using namespace SOCI::tests; - -std::string connectString; -BackEndFactory const &backEnd = sqlite3; - -// ROWID test -// In sqlite3 the row id can be called ROWID, _ROWID_ or oid -void test1() -{ - { - Session sql(backEnd, connectString); - - try { sql << "drop table test1"; } - catch (SOCIError const &) {} // ignore if error - - sql << - "create table test1 (" - " id integer," - " name varchar(100)" - ")"; - - sql << "insert into test1(id, name) values(7, \'John\')"; - - RowID rid(sql); - sql << "select oid from test1 where id = 7", into(rid); - - int id; - std::string name; - - sql << "select id, name from test1 where oid = :rid", - into(id), into(name), use(rid); - - assert(id == 7); - assert(name == "John"); - - sql << "drop table test1"; - } - - std::cout << "test 1 passed" << std::endl; -} - -// Blob Test -void test2() -{ - { - Session sql(backEnd, connectString); - - try - { - // expected error - BLOB b(sql); - assert(false); - } - catch (SOCIError const &e) - { - std::string msg = e.what(); - assert(msg == - "BLOBs are not supported."); - } - - } - - std::cout << "test 2 passed" << std::endl; -} - - -// This test was put in to fix a problem that occurs when there are both -//into and use elements in the same query and one of them (into) binds -//to a vector object. -void test3() -{ - { - Session sql(backEnd, connectString); - - try { sql << "drop table test3"; } - catch (SOCIError const &) {} //ignore error if table doesn't exist - - sql << "Create table test3( id integer, name varchar, subname varchar);"; - - sql << "Insert into test3(id,name,subname) values( 1,'john','smith')"; - sql << "Insert into test3(id,name,subname) values( 2,'george','vals')"; - sql << "Insert into test3(id,name,subname) values( 3,'ann','smith')"; - sql << "Insert into test3(id,name,subname) values( 4,'john','grey')"; - sql << "Insert into test3(id,name,subname) values( 5,'anthony','wall')"; - - std::vector<int> v(10); - - Statement s(sql.prepare << "Select id from test3 where name = :name"); - - std::string name = "john"; - - s.exchange(use(name, "name")); - s.exchange(into(v)); - - s.defineAndBind(); - s.execute(true); - - assert(v.size() == 2); - } - std::cout << "test 3 passed" << std::endl; -} - -// DDL Creation objects for common tests -struct TableCreator1 : public TableCreatorBase -{ - TableCreator1(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(id integer, val integer, c char, " - "str varchar(20), sh smallint, ul numeric(20), d float, " - "tm datetime, i1 integer, i2 integer, i3 integer, " - "name varchar(20))"; - } -}; - -struct TableCreator2 : public TableCreatorBase -{ - TableCreator2(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(num_float float, num_int integer," - " name varchar(20), sometime datetime, chr char)"; - } -}; - -struct TableCreator3 : public TableCreatorBase -{ - TableCreator3(Session& session) - : TableCreatorBase(session) - { - session << "create table soci_test(name varchar(100) not null, " - "phone varchar(15))"; - } -}; - -// -// Support for SOCI Common Tests -// - -class TestContext : public TestContextBase -{ -public: - TestContext(BackEndFactory const &backEnd, - std::string const &connectString) - : TestContextBase(backEnd, connectString) {} - - TableCreatorBase* tableCreator1(Session& s) const - { - return new TableCreator1(s); - } - - TableCreatorBase* tableCreator2(Session& s) const - { - return new TableCreator2(s); - } - - TableCreatorBase* tableCreator3(Session& s) const - { - return new TableCreator3(s); - } - - std::string toDateTime(std::string const &dateString) const - { - return "datetime(\'" + dateString + "\')"; - } -}; - -int main(int argc, char** argv) -{ - -#ifdef _MSC_VER - // Redirect errors, unrecoverable problems, and assert() failures to STDERR, - // instead of debug message window. - // This hack is required to run asser()-driven tests by Buildbot. - // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside. - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); -#endif //_MSC_VER - - if (argc == 2) - { - connectString = argv[1]; - } - else - { - std::cout << "usage: " << argv[0] - << " database_file_name\n" - << "example: " << argv[0] - << " foo.data\n"; - exit(1); - } - - try - { - TestContext tc(backEnd, connectString); - CommonTests tests(tc); - tests.run(); - - std::cout << "\nSOCI sqlite3 Tests:\n\n"; - - test1(); - test2(); - test3(); - - std::cout << "\nOK, all tests passed.\n\n"; - } - catch (SOCI::SOCIError const & e) - { - std::cout << "SOCIERROR: " << e.what() << '\n'; - } - catch (std::exception const & e) - { - std::cout << "EXCEPTION: " << e.what() << '\n'; - } -} diff --git a/src/backends/sqlite3/vector-into-type.cpp b/src/backends/sqlite3/vector-into-type.cpp deleted file mode 100644 index c88b1c82..00000000 --- a/src/backends/sqlite3/vector-into-type.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - - -#include "soci.h" -#include "soci-sqlite3.h" - -#include "common.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#define strtoll(s, p, b) static_cast<long long>(_strtoi64(s, p, b)) -#endif - -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Sqlite3; - - -void Sqlite3VectorIntoTypeBackEnd::defineByPos(int & position, void * data, - eExchangeType type) -{ - data_ = data; - type_ = type; - position_ = position++; -} - -void Sqlite3VectorIntoTypeBackEnd::preFetch() -{ - // ... -} - -namespace // anonymous -{ - -template <typename T, typename U> -void setInVector(void *p, int indx, U const &val) -{ - std::vector<T> *dest = - static_cast<std::vector<T> *>(p); - - std::vector<T> &v = *dest; - v[indx] = val; -} - -} // namespace anonymous - -void Sqlite3VectorIntoTypeBackEnd::postFetch(bool gotData, eIndicator * ind) -{ - if (gotData) - { - int endRow = static_cast<int>(statement_.dataCache_.size()); - for (int i = 0; i < endRow; ++i) - { - const Sqlite3Column& curCol = - statement_.dataCache_[i][position_-1]; - - if (curCol.isNull_) - { - if (ind == NULL) - { - throw SOCIError( - "Null value fetched and no indicator defined."); - } - - ind[i] = eNull; - } - else - { - if (ind != NULL) - { - ind[i] = eOK; - } - } - - const char * buf = curCol.data_.c_str(); - - - // set buf to a null string if a null pointer is returned - if (!buf) - { - buf = ""; - } - - switch (type_) - { - case eXChar: - setInVector<char>(data_, i, *buf); - break; - case eXStdString: - setInVector<std::string>(data_, i, buf); - break; - case eXShort: - { - long val = strtol(buf, NULL, 10); - setInVector<short>(data_, i, static_cast<short>(val)); - } - break; - case eXInteger: - { - long val = strtol(buf, NULL, 10); - setInVector<int>(data_, i, static_cast<int>(val)); - } - break; - case eXUnsignedLong: - { - long long val = strtoll(buf, NULL, 10); - setInVector<unsigned long>(data_, i, - static_cast<unsigned long>(val)); - } - break; - case eXDouble: - { - double val = strtod(buf, NULL); - setInVector<double>(data_, i, val); - } - break; - case eXStdTm: - { - // attempt to parse the string and convert to std::tm - std::tm t; - parseStdTm(buf, t); - - setInVector<std::tm>(data_, i, t); - } - break; - - default: - throw SOCIError("Into element used with non-supported type."); - } - } - } - else // no data retrieved - { - // nothing to do, into vectors are already truncated - } -} - -void Sqlite3VectorIntoTypeBackEnd::resize(std::size_t sz) -{ - switch (type_) - { - // simple cases - case eXChar: resizeVector<char> (data_, sz); break; - case eXShort: resizeVector<short> (data_, sz); break; - case eXInteger: resizeVector<int> (data_, sz); break; - case eXUnsignedLong: resizeVector<unsigned long>(data_, sz); break; - case eXDouble: resizeVector<double> (data_, sz); break; - case eXStdString: resizeVector<std::string> (data_, sz); break; - case eXStdTm: resizeVector<std::tm> (data_, sz); break; - - default: - throw SOCIError("Into vector element used with non-supported type."); - } -} - -std::size_t Sqlite3VectorIntoTypeBackEnd::size() -{ - std::size_t sz = 0; // dummy initialization to please the compiler - switch (type_) - { - // simple cases - case eXChar: sz = getVectorSize<char> (data_); break; - case eXShort: sz = getVectorSize<short> (data_); break; - case eXInteger: sz = getVectorSize<int> (data_); break; - case eXUnsignedLong: sz = getVectorSize<unsigned long>(data_); break; - case eXDouble: sz = getVectorSize<double> (data_); break; - case eXStdString: sz = getVectorSize<std::string> (data_); break; - case eXStdTm: sz = getVectorSize<std::tm> (data_); break; - - default: - throw SOCIError("Into vector element used with non-supported type."); - } - - return sz; -} - -void Sqlite3VectorIntoTypeBackEnd::cleanUp() -{ - // ... -} diff --git a/src/backends/sqlite3/vector-use-type.cpp b/src/backends/sqlite3/vector-use-type.cpp deleted file mode 100644 index c90ba763..00000000 --- a/src/backends/sqlite3/vector-use-type.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - - -#include "soci.h" -#include "soci-sqlite3.h" - -#include "common.h" -#include <limits> - -#ifdef _MSC_VER -#pragma warning(disable:4355 4996) -#define snprintf _snprintf -#endif - -using namespace SOCI; -using namespace SOCI::details; -using namespace SOCI::details::Sqlite3; - -void Sqlite3VectorUseTypeBackEnd::bindByPos(int & position, - void * data, - eExchangeType type) -{ - if (statement_.boundByName_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - data_ = data; - type_ = type; - position_ = position++; - - statement_.boundByPos_ = true; -} - -void Sqlite3VectorUseTypeBackEnd::bindByName(std::string const & name, - void * data, - eExchangeType type) -{ - if (statement_.boundByPos_) - { - throw SOCIError( - "Binding for use elements must be either by position or by name."); - } - - data_ = data; - type_ = type; - name_ = ":" + name; - - statement_.resetIfNeeded(); - position_ = sqlite3_bind_parameter_index(statement_.stmt_, name_.c_str()); - - if (0 == position_) - { - std::ostringstream ss; - ss << "Cannot bind (by name) to " << name_; - throw SOCIError(ss.str()); - } - statement_.boundByName_ = true; -} - -void Sqlite3VectorUseTypeBackEnd::preUse(eIndicator const * ind) -{ - std::size_t const vsize = size(); - - // make sure that useData can hold enough rows - if (statement_.useData_.size() != vsize) - statement_.useData_.resize(vsize); - - int pos = position_ - 1; - - for (size_t i = 0; i != vsize; ++i) - { - char *buf = 0; - - // make sure that each row can accomodate the number of columns - if (statement_.useData_[i].size() < - static_cast<std::size_t>(position_)) - statement_.useData_[i].resize(position_); - - // the data in vector can be either eOK or eNull - if (ind != NULL && ind[i] == eNull) - { - statement_.useData_[i][pos].isNull_ = true; - statement_.useData_[i][pos].data_ = ""; - } - else - { - // allocate and fill the buffer with text-formatted client data - switch (type_) - { - case eXChar: - { - std::vector<char> *pv - = static_cast<std::vector<char> *>(data_); - std::vector<char> &v = *pv; - - buf = new char[2]; - buf[0] = v[i]; - buf[1] = '\0'; - } - break; - case eXStdString: - { - std::vector<std::string> *pv - = static_cast<std::vector<std::string> *>(data_); - std::vector<std::string> &v = *pv; - - buf = new char[v[i].size() + 1]; - std::strcpy(buf, v[i].c_str()); - } - break; - case eXShort: - { - std::vector<short> *pv - = static_cast<std::vector<short> *>(data_); - std::vector<short> &v = *pv; - - std::size_t const bufSize - = std::numeric_limits<short>::digits10 + 3; - buf = new char[bufSize]; - snprintf(buf, bufSize, "%d", static_cast<int>(v[i])); - } - break; - case eXInteger: - { - std::vector<int> *pv - = static_cast<std::vector<int> *>(data_); - std::vector<int> &v = *pv; - - std::size_t const bufSize - = std::numeric_limits<int>::digits10 + 3; - buf = new char[bufSize]; - snprintf(buf, bufSize, "%d", v[i]); - } - break; - case eXUnsignedLong: - { - std::vector<unsigned long> *pv - = static_cast<std::vector<unsigned long> *>(data_); - std::vector<unsigned long> &v = *pv; - - std::size_t const bufSize - = std::numeric_limits<unsigned long>::digits10 + 2; - buf = new char[bufSize]; - snprintf(buf, bufSize, "%lu", v[i]); - } - break; - case eXDouble: - { - // no need to overengineer it (KISS)... - - std::vector<double> *pv - = static_cast<std::vector<double> *>(data_); - std::vector<double> &v = *pv; - - std::size_t const bufSize = 100; - buf = new char[bufSize]; - - snprintf(buf, bufSize, "%.20g", v[i]); - } - break; - case eXStdTm: - { - std::vector<std::tm> *pv - = static_cast<std::vector<std::tm> *>(data_); - std::vector<std::tm> &v = *pv; - - std::size_t const bufSize = 20; - buf = new char[bufSize]; - - snprintf(buf, bufSize, "%d-%02d-%02d %02d:%02d:%02d", - v[i].tm_year + 1900, v[i].tm_mon + 1, v[i].tm_mday, - v[i].tm_hour, v[i].tm_min, v[i].tm_sec); - } - break; - - default: - throw SOCIError( - "Use vector element used with non-supported type."); - } - - statement_.useData_[i][pos].isNull_ = false; - statement_.useData_[i][pos].data_ = buf; - } - if (buf) - delete[] buf; - } -} - -std::size_t Sqlite3VectorUseTypeBackEnd::size() -{ - std::size_t sz = 0; // dummy initialization to please the compiler - switch (type_) - { - // simple cases - case eXChar: sz = getVectorSize<char> (data_); break; - case eXShort: sz = getVectorSize<short> (data_); break; - case eXInteger: sz = getVectorSize<int> (data_); break; - case eXUnsignedLong: sz = getVectorSize<unsigned long>(data_); break; - case eXDouble: sz = getVectorSize<double> (data_); break; - case eXStdString: sz = getVectorSize<std::string> (data_); break; - case eXStdTm: sz = getVectorSize<std::tm> (data_); break; - - default: - throw SOCIError("Use vector element used with non-supported type."); - } - - return sz; -} - -void Sqlite3VectorUseTypeBackEnd::cleanUp() -{ - // ... -} diff --git a/src/core/Makefile.am b/src/core/Makefile.am deleted file mode 100644 index ae0ae1e6..00000000 --- a/src/core/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:32 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -AM_CXXFLAGS = -fPIC - -SUBDIRS = test - -lib_LTLIBRARIES = lib@SOCI_CORE_LIBRARY_NAME@.la - -lib@SOCI_CORE_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_CORE_LIBRARY_NAME@_la_SOURCES = \ - soci.cpp - -socidir = $(includedir)/soci - -soci_HEADERS = \ - soci.h \ - soci-backend.h \ - soci-config.h \ - soci-platform.h - -EXTRA_DIST = Makefile.basic - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/core/Makefile.basic b/src/core/Makefile.basic index 74a99d94..3d987651 100644 --- a/src/core/Makefile.basic +++ b/src/core/Makefile.basic @@ -1,20 +1,76 @@ COMPILER = g++ CXXFLAGS = -Wall -pedantic -Wno-long-long +INCLUDEDIRS = +OBJS = session.o statement.o row.o values.o \ + into-type.o use-type.o \ + blob.o rowid.o procedure.o ref-counted-prepare-info.o ref-counted-statement.o \ + once-temp-type.o prepare-temp-type.o error.o transaction.o backend-loader.o \ + connection-pool.o soci-simple.o -libsoci-core.a : soci.o +libsoci_core.a : ${OBJS} ar rv $@ $? rm *.o -soci.o : soci.cpp - ${COMPILER} -c $? ${CXXFLAGS} +shared : ${OBJS} + ${COMPILER} -fPIC -c $? ${CXXFLAGS} ${INCLUDEDIRS} + ${COMPILER} -shared -o libsoci_core.so ${OBJS} + rm *.o +session.o : session.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} -shared : soci.cpp - ${COMPILER} -fPIC -c $? ${CXXFLAGS} - ${COMPILER} -shared -o libsoci-core.so soci.o - rm *.o +statement.o : statement.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +row.o : row.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +values.o : values.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +into-type.o : into-type.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +use-type.o : use-type.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +blob.o : blob.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +error.o : error.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +rowid.o : rowid.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +procedure.o : procedure.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +ref-counted-prepare-info.o : ref-counted-prepare-info.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +ref-counted-statement.o : ref-counted-statement.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +once-temp-type.o : once-temp-type.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +prepare-temp-type.o : prepare-temp-type.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +transaction.o : transaction.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +backend-loader.o : backend-loader.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +connection-pool.o : connection-pool.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + +soci-simple.o : soci-simple.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} clean : - rm -f libsoci-core.a libsoci-core.so + rm -f libsoci_core.a libsoci_core.so diff --git a/src/core/Makefile.in b/src/core/Makefile.in deleted file mode 100644 index c789cb26..00000000 --- a/src/core/Makefile.in +++ /dev/null @@ -1,652 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/core -DIST_COMMON = $(soci_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(socidir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -lib@SOCI_CORE_LIBRARY_NAME@_la_LIBADD = -am_lib@SOCI_CORE_LIBRARY_NAME@_la_OBJECTS = soci.lo -lib@SOCI_CORE_LIBRARY_NAME@_la_OBJECTS = \ - $(am_lib@SOCI_CORE_LIBRARY_NAME@_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib@SOCI_CORE_LIBRARY_NAME@_la_SOURCES) -DIST_SOURCES = $(lib@SOCI_CORE_LIBRARY_NAME@_la_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -sociHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(soci_HEADERS) -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# $Id: Makefile.am,v 1.4 2006/11/27 09:59:32 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# -AM_CXXFLAGS = -fPIC -SUBDIRS = test -lib_LTLIBRARIES = lib@SOCI_CORE_LIBRARY_NAME@.la -lib@SOCI_CORE_LIBRARY_NAME@_la_LDFLAGS = \ - -release @LIBTOOL_RELEASE@ - -lib@SOCI_CORE_LIBRARY_NAME@_la_SOURCES = \ - soci.cpp - -socidir = $(includedir)/soci -soci_HEADERS = \ - soci.h \ - soci-backend.h \ - soci-config.h \ - soci-platform.h - -EXTRA_DIST = Makefile.basic -MAINTAINERCLEANLOCAL = Makefile.in -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/core/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/core/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -lib@SOCI_CORE_LIBRARY_NAME@.la: $(lib@SOCI_CORE_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_CORE_LIBRARY_NAME@_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(lib@SOCI_CORE_LIBRARY_NAME@_la_LDFLAGS) $(lib@SOCI_CORE_LIBRARY_NAME@_la_OBJECTS) $(lib@SOCI_CORE_LIBRARY_NAME@_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/soci.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-sociHEADERS: $(soci_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(socidir)" || $(mkdir_p) "$(DESTDIR)$(socidir)" - @list='$(soci_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(sociHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(socidir)/$$f'"; \ - $(sociHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(socidir)/$$f"; \ - done - -uninstall-sociHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(soci_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(socidir)/$$f'"; \ - rm -f "$(DESTDIR)$(socidir)/$$f"; \ - done - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(socidir)"; 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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: install-sociHEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-sociHEADERS - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-recursive ctags ctags-recursive distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-libLTLIBRARIES install-man \ - install-sociHEADERS install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-local \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-sociHEADERS - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/core/backend-loader.cpp b/src/core/backend-loader.cpp new file mode 100644 index 00000000..17d76897 --- /dev/null +++ b/src/core/backend-loader.cpp @@ -0,0 +1,314 @@ +// +// Copyright (C) 2008 Maciej Sobczak with contributions from Artyom Tonkikh +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "backend-loader.h" +#include "error.h" +#include <map> +#include <cassert> +#include <cstdlib> + +using namespace soci; +using namespace soci::dynamic_backends; + +#ifdef _WIN32 + +#include <windows.h> + +typedef CRITICAL_SECTION soci_mutex_t; +typedef HMODULE soci_handler_t; + +#define LOCK(x) EnterCriticalSection(x) +#define UNLOCK(x) LeaveCriticalSection(x) +#define MUTEX_INIT(x) InitializeCriticalSection(x) +#define MUTEX_DEST(x) DeleteCriticalSection(x) +#define DLOPEN(x) LoadLibrary(x) +#define DLCLOSE(x) FreeLibrary(x) +#define DLSYM(x, y) GetProcAddress(x, y) +#define LIBNAME(x) ("libsoci_" + x + ".dll") + +#else + +#include <pthread.h> +#include <dlfcn.h> + +typedef pthread_mutex_t soci_mutex_t; +typedef void * soci_handler_t; + +#define LOCK(x) pthread_mutex_lock(x) +#define UNLOCK(x) pthread_mutex_unlock(x) +#define MUTEX_INIT(x) pthread_mutex_init(x, NULL) +#define MUTEX_DEST(x) pthread_mutex_destroy(x) +#define DLOPEN(x) dlopen(x, RTLD_LAZY) +#define DLCLOSE(x) dlclose(x) +#define DLSYM(x, y) dlsym(x, y) +#define LIBNAME(x) ("libsoci_" + x + ".so") + +#endif // _WIN32 + + +namespace // unnamed +{ + +struct info +{ + soci_handler_t handler_; + backend_factory const * factory_; + info() : handler_(NULL), factory_(NULL) {} +}; + +typedef std::map<std::string, info> factory_map; +factory_map factories_; + +std::vector<std::string> search_paths_; + +soci_mutex_t mutex_; + +std::vector<std::string> get_default_paths() +{ + std::vector<std::string> paths; + + char const * const penv = std::getenv("SOCI_BACKENDS_PATH"); + if (penv == NULL) + { + paths.push_back("."); + return paths; + } + + std::string const env = penv; + if (env.empty()) + { + paths.push_back("."); + return paths; + } + + std::string::size_type searchFrom = 0; + while (searchFrom != env.size()) + { + std::string::size_type const found = env.find(":", searchFrom); + if (found == searchFrom) + { + ++searchFrom; + } + else if (found != std::string::npos) + { + std::string const path = env.substr(searchFrom, found - searchFrom); + paths.push_back(path); + + searchFrom = found + 1; + } + else // found == npos + { + std::string const path = env.substr(searchFrom); + paths.push_back(path); + + searchFrom = env.size(); + } + } + + return paths; +} + +// used to automatically initialize the global state +struct static_state_mgr +{ + static_state_mgr() + { + MUTEX_INIT(&mutex_); + + search_paths_ = get_default_paths(); + } + + ~static_state_mgr() + { + unload_all(); + + MUTEX_DEST(&mutex_); + } +} static_state_mgr_; + +class scoped_lock +{ +public: + scoped_lock(soci_mutex_t * m) : mptr(m) { LOCK(m); }; + ~scoped_lock() { UNLOCK(mptr); }; +private: + soci_mutex_t * mptr; +}; + +// non-synchronized helper for the other functions +void do_unload(std::string const & name) +{ + factory_map::iterator i = factories_.find(name); + + if (i != factories_.end()) + { + soci_handler_t h = i->second.handler_; + if (h != NULL) + { + DLCLOSE(h); + } + + factories_.erase(i); + } +} + +// non-synchronized helper +void do_register_backend( + std::string const & name, std::string const & shared_object) +{ + // The rules for backend search are as follows: + // - if the shared_object is given, + // it names the library file and the search paths are not used + // - otherwise (shared_object not provided or empty): + // - file named libsoci_NAME.so is searched in the list of search paths + + soci_handler_t h = NULL; + if (shared_object.empty() == false) + { + h = DLOPEN(shared_object.c_str()); + } + else + { + // try all search paths + for (std::size_t i = 0; i != search_paths_.size(); ++i) + { + std::string const fullFileName = search_paths_[i] + "/" + LIBNAME(name); + h = DLOPEN(fullFileName.c_str()); + if (h != NULL) + { + // already found + break; + } + } + } + + if (h == NULL) + { + throw soci_error("Failed to find shared library for backend " + name); + } + + std::string symbol = "factory_" + name; + + typedef backend_factory const * bfc_ptr; + typedef bfc_ptr (*get_t)(void); + get_t entry; + entry = reinterpret_cast<get_t>(reinterpret_cast<long>(DLSYM(h, symbol.c_str()))); + + if (entry == NULL) + { + DLCLOSE(h); + throw soci_error("Failed to resolve dynamic symbol: " + symbol); + } + + // unload the existing handler if it's already loaded + + do_unload(name); + + backend_factory const * f = entry(); + + info new_entry; + new_entry.factory_ = f; + new_entry.handler_ = h; + + factories_[name] = new_entry; +} + +} // unnamed namespace + +backend_factory const & dynamic_backends::get(std::string const & name) +{ + scoped_lock lock(&mutex_); + + factory_map::iterator i = factories_.find(name); + + if (i != factories_.end()) + { + return *(i->second.factory_); + } + + // no backend found with this name, try to register it first + + do_register_backend(name, std::string()); + + // second attempt, must succeed (the backend is already loaded) + + i = factories_.find(name); + + assert(i != factories_.end()); + + return *(i->second.factory_); +} + +std::vector<std::string> & search_paths() +{ + return search_paths_; +} + +void dynamic_backends::register_backend( + std::string const & name, std::string const & shared_object) +{ + scoped_lock lock(&mutex_); + + do_register_backend(name, shared_object); +} + +void dynamic_backends::register_backend( + std::string const & name, backend_factory const & factory) +{ + scoped_lock lock(&mutex_); + + // unload the existing handler if it's already loaded + + do_unload(name); + + info new_entry; + new_entry.factory_ = &factory; + + factories_[name] = new_entry; +} + +std::vector<std::string> dynamic_backends::list_all() +{ + scoped_lock lock(&mutex_); + + std::vector<std::string> ret; + ret.reserve(factories_.size()); + + factory_map::iterator i; + for (i = factories_.begin(); i != factories_.end(); ++i) + { + std::string const & name = i->first; + ret.push_back(name); + } + + return ret; +} + +void dynamic_backends::unload(std::string const & name) +{ + scoped_lock lock(&mutex_); + + do_unload(name); +} + +void dynamic_backends::unload_all() +{ + scoped_lock lock(&mutex_); + + factory_map::iterator i; + for (i = factories_.begin(); i != factories_.end(); ++i) + { + soci_handler_t h = i->second.handler_; + if (h != NULL) + { + DLCLOSE(h); + } + } + + factories_.clear(); +} diff --git a/src/core/backend-loader.h b/src/core/backend-loader.h new file mode 100644 index 00000000..af7405bb --- /dev/null +++ b/src/core/backend-loader.h @@ -0,0 +1,36 @@ +// +// Copyright (C) 2008 Maciej Sobczak with contributions from Artyom Tonkikh +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_BACKEND_LOADER_H_INCLUDED +#define SOCI_BACKEND_LOADER_H_INCLUDED + +#include "soci-backend.h" +#include <string> +#include <vector> + +namespace soci +{ + +namespace dynamic_backends +{ + +// used internally by session +backend_factory const & get(std::string const & name); + +// provided for advanced user-level management +std::vector<std::string> & search_paths(); +void register_backend(std::string const & name, std::string const & shared_object = std::string()); +void register_backend(std::string const & name, backend_factory const & factory); +std::vector<std::string> list_all(); +void unload(std::string const & name); +void unload_all(); + +} // namespace dynamic_backends + +} // namespace soci + +#endif // SOCI_BACKEND_LOADER_H_INCLUDED diff --git a/src/core/blob-exchange.h b/src/core/blob-exchange.h new file mode 100644 index 00000000..5cc9e06d --- /dev/null +++ b/src/core/blob-exchange.h @@ -0,0 +1,56 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_BLOB_EXCHANGE_H_INCLUDED +#define SOCI_BLOB_EXCHANGE_H_INCLUDED + +#include "blob.h" +#include "into-type.h" +#include "use-type.h" + +namespace soci +{ + +namespace details +{ + +template <> +class into_type<blob> : public standard_into_type +{ +public: + into_type(blob & b) : standard_into_type(&b, x_blob) {} + into_type(blob & b, indicator & ind) + : standard_into_type(&b, x_blob, ind) {} +}; + +template <> +class use_type<blob> : public standard_use_type +{ +public: + use_type(blob & b, std::string const & name = std::string()) + : standard_use_type(&b, x_blob, false, name) {} + use_type(blob const & b, std::string const & name = std::string()) + : standard_use_type(const_cast<blob *>(&b), x_blob, true, name) {} + use_type(blob & b, indicator & ind, + std::string const & name = std::string()) + : standard_use_type(&b, x_blob, ind, false, name) {} + use_type(blob const & b, indicator & ind, + std::string const & name = std::string()) + : standard_use_type(const_cast<blob *>(&b), x_blob, ind, true, name) {} +}; + +template <> +struct exchange_traits<soci::blob> +{ + typedef basic_type_tag type_family; +}; + +} // namespace details + +} // namespace soci + +#endif // SOCI_BLOB_EXCHANGE_H_INCLUDED diff --git a/src/core/blob.cpp b/src/core/blob.cpp new file mode 100644 index 00000000..91c779d2 --- /dev/null +++ b/src/core/blob.cpp @@ -0,0 +1,50 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "blob.h" +#include "session.h" + +#include <cstddef> + +using namespace soci; + +blob::blob(session & s) +{ + backEnd_ = s.make_blob_backend(); +} + +blob::~blob() +{ + delete backEnd_; +} + +std::size_t blob::get_len() +{ + return backEnd_->get_len(); +} + +std::size_t blob::read(std::size_t offset, char *buf, std::size_t toRead) +{ + return backEnd_->read(offset, buf, toRead); +} + +std::size_t blob::write( + std::size_t offset, char const * buf, std::size_t toWrite) +{ + return backEnd_->write(offset, buf, toWrite); +} + +std::size_t blob::append(char const * buf, std::size_t toWrite) +{ + return backEnd_->append(buf, toWrite); +} + +void blob::trim(std::size_t newLen) +{ + backEnd_->trim(newLen); +} diff --git a/src/core/blob.h b/src/core/blob.h new file mode 100644 index 00000000..b98f4d09 --- /dev/null +++ b/src/core/blob.h @@ -0,0 +1,47 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_BLOB_H_INCLUDED +#define SOCI_BLOB_H_INCLUDED + +#include "soci-config.h" + +#include <cstddef> + +namespace soci +{ +// basic blob operations + +class session; + +namespace details +{ +class blob_backend; +} // namespace details + +class SOCI_DECL blob +{ +public: + explicit blob(session & s); + ~blob(); + + std::size_t get_len(); + std::size_t read(std::size_t offset, char * buf, std::size_t toRead); + std::size_t write(std::size_t offset, char const * buf, + std::size_t toWrite); + std::size_t append(char const * buf, std::size_t toWrite); + void trim(std::size_t newLen); + + details::blob_backend * get_backend() { return backEnd_; } + +private: + details::blob_backend * backEnd_; +}; + +} // namespace soci + +#endif diff --git a/src/core/boost-fusion.h b/src/core/boost-fusion.h new file mode 100644 index 00000000..e6b6e01c --- /dev/null +++ b/src/core/boost-fusion.h @@ -0,0 +1,323 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_BOOST_FUSION_H_INCLUDED +#define SOCI_BOOST_FUSION_H_INCLUDED + +#include "values.h" +#include "type-conversion-traits.h" + +#include <boost/fusion/container/vector.hpp> +#include <boost/fusion/sequence/intrinsic/at.hpp> +#include <boost/fusion/include/at.hpp> + +namespace soci +{ + +template <typename T0> +struct type_conversion<boost::fusion::vector<T0> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0> & out) + { + in + >> boost::fusion::at_c<0>(out); + } + + static void to_base(boost::fusion::vector<T0> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in); + } +}; + +template <typename T0, typename T1> +struct type_conversion<boost::fusion::vector<T0, T1> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out); + } + + static void to_base(boost::fusion::vector<T0, T1> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in); + } +}; + +template <typename T0, typename T1, typename T2> +struct type_conversion<boost::fusion::vector<T0, T1, T2> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1, T2> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out) + >> boost::fusion::at_c<2>(out); + } + + static void to_base(boost::fusion::vector<T0, T1, T2> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in) + << boost::fusion::at_c<2>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3> +struct type_conversion<boost::fusion::vector<T0, T1, T2, T3> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1, T2, T3> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out) + >> boost::fusion::at_c<2>(out) + >> boost::fusion::at_c<3>(out); + } + + static void to_base(boost::fusion::vector<T0, T1, T2, T3> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in) + << boost::fusion::at_c<2>(in) + << boost::fusion::at_c<3>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4> +struct type_conversion<boost::fusion::vector<T0, T1, T2, T3, T4> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1, T2, T3, T4> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out) + >> boost::fusion::at_c<2>(out) + >> boost::fusion::at_c<3>(out) + >> boost::fusion::at_c<4>(out); + } + + static void to_base(boost::fusion::vector<T0, T1, T2, T3, T4> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in) + << boost::fusion::at_c<2>(in) + << boost::fusion::at_c<3>(in) + << boost::fusion::at_c<4>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5> +struct type_conversion<boost::fusion::vector<T0, T1, T2, T3, T4, T5> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1, T2, T3, T4, T5> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out) + >> boost::fusion::at_c<2>(out) + >> boost::fusion::at_c<3>(out) + >> boost::fusion::at_c<4>(out) + >> boost::fusion::at_c<5>(out); + } + + static void to_base(boost::fusion::vector<T0, T1, T2, T3, T4, T5> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in) + << boost::fusion::at_c<2>(in) + << boost::fusion::at_c<3>(in) + << boost::fusion::at_c<4>(in) + << boost::fusion::at_c<5>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6> +struct type_conversion<boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out) + >> boost::fusion::at_c<2>(out) + >> boost::fusion::at_c<3>(out) + >> boost::fusion::at_c<4>(out) + >> boost::fusion::at_c<5>(out) + >> boost::fusion::at_c<6>(out); + } + + static void to_base(boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in) + << boost::fusion::at_c<2>(in) + << boost::fusion::at_c<3>(in) + << boost::fusion::at_c<4>(in) + << boost::fusion::at_c<5>(in) + << boost::fusion::at_c<6>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6, typename T7> +struct type_conversion<boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out) + >> boost::fusion::at_c<2>(out) + >> boost::fusion::at_c<3>(out) + >> boost::fusion::at_c<4>(out) + >> boost::fusion::at_c<5>(out) + >> boost::fusion::at_c<6>(out) + >> boost::fusion::at_c<7>(out); + } + + static void to_base( + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in) + << boost::fusion::at_c<2>(in) + << boost::fusion::at_c<3>(in) + << boost::fusion::at_c<4>(in) + << boost::fusion::at_c<5>(in) + << boost::fusion::at_c<6>(in) + << boost::fusion::at_c<7>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6, typename T7, typename T8> +struct type_conversion< + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out) + >> boost::fusion::at_c<2>(out) + >> boost::fusion::at_c<3>(out) + >> boost::fusion::at_c<4>(out) + >> boost::fusion::at_c<5>(out) + >> boost::fusion::at_c<6>(out) + >> boost::fusion::at_c<7>(out) + >> boost::fusion::at_c<8>(out); + } + + static void to_base( + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in) + << boost::fusion::at_c<2>(in) + << boost::fusion::at_c<3>(in) + << boost::fusion::at_c<4>(in) + << boost::fusion::at_c<5>(in) + << boost::fusion::at_c<6>(in) + << boost::fusion::at_c<7>(in) + << boost::fusion::at_c<8>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6, typename T7, typename T8, typename T9> +struct type_conversion< + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & out) + { + in + >> boost::fusion::at_c<0>(out) + >> boost::fusion::at_c<1>(out) + >> boost::fusion::at_c<2>(out) + >> boost::fusion::at_c<3>(out) + >> boost::fusion::at_c<4>(out) + >> boost::fusion::at_c<5>(out) + >> boost::fusion::at_c<6>(out) + >> boost::fusion::at_c<7>(out) + >> boost::fusion::at_c<8>(out) + >> boost::fusion::at_c<9>(out); + } + + static void to_base( + boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & in, + base_type & out, indicator & ind) + { + out + << boost::fusion::at_c<0>(in) + << boost::fusion::at_c<1>(in) + << boost::fusion::at_c<2>(in) + << boost::fusion::at_c<3>(in) + << boost::fusion::at_c<4>(in) + << boost::fusion::at_c<5>(in) + << boost::fusion::at_c<6>(in) + << boost::fusion::at_c<7>(in) + << boost::fusion::at_c<8>(in) + << boost::fusion::at_c<9>(in); + } +}; + +} // namespace soci + +#endif // SOCI_BOOST_FUSION_H_INCLUDED diff --git a/src/core/boost-gregorian-date.h b/src/core/boost-gregorian-date.h new file mode 100644 index 00000000..87a93fd4 --- /dev/null +++ b/src/core/boost-gregorian-date.h @@ -0,0 +1,46 @@ +// +// Copyright (C) 2008 Maciej Sobczak +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_BOOST_GREGORIAN_DATE_H_INCLUDED +#define SOCI_BOOST_GREGORIAN_DATE_H_INCLUDED + +#include "type-conversion-traits.h" + +#include <boost/date_time/gregorian/gregorian_types.hpp> +#include <boost/date_time/gregorian/conversion.hpp> +#include <ctime> + +namespace soci +{ + +template<> +struct type_conversion<boost::gregorian::date> +{ + typedef std::tm base_type; + + static void from_base( + base_type const & in, indicator ind, boost::gregorian::date & out) + { + if (ind == i_null) + { + throw soci_error("Null value not allowed for this type"); + } + + out = boost::gregorian::date_from_tm(in); + } + + static void to_base( + boost::gregorian::date const & in, base_type & out, indicator & ind) + { + out = boost::gregorian::to_tm(in); + ind = i_ok; + } +}; + +} // namespace soci + +#endif // SOCI_BOOST_GREGORIAN_DATE_H_INCLUDED diff --git a/src/core/boost-optional.h b/src/core/boost-optional.h new file mode 100644 index 00000000..13cd65db --- /dev/null +++ b/src/core/boost-optional.h @@ -0,0 +1,55 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_BOOST_OPTIONAL_H_INCLUDED +#define SOCI_BOOST_OPTIONAL_H_INCLUDED + +#include "type-conversion-traits.h" + +#include <boost/optional.hpp> + +namespace soci +{ + +// simple fall-back for boost::optional +template <typename T> +struct type_conversion<boost::optional<T> > +{ + typedef typename type_conversion<T>::base_type base_type; + + static void from_base(base_type const & in, indicator ind, + boost::optional<T> & out) + { + if (ind == i_null) + { + out.reset(); + } + else + { + T tmp; + type_conversion<T>::from_base(in, ind, tmp); + out = tmp; + } + } + + static void to_base(boost::optional<T> const & in, + base_type & out, indicator & ind) + { + if (in.is_initialized()) + { + type_conversion<T>::to_base(in.get(), out, ind); + } + else + { + ind = i_null; + } + } +}; + +} // namespace soci + +#endif // SOCI_BOOST_OPTIONAL_H_INCLUDED diff --git a/src/core/boost-tuple.h b/src/core/boost-tuple.h new file mode 100644 index 00000000..256a23d3 --- /dev/null +++ b/src/core/boost-tuple.h @@ -0,0 +1,317 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_BOOST_TUPLE_H_INCLUDED +#define SOCI_BOOST_TUPLE_H_INCLUDED + +#include "values.h" +#include "type-conversion-traits.h" + +#include <boost/tuple/tuple.hpp> + +namespace soci +{ + +template <typename T0> +struct type_conversion<boost::tuple<T0> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0> & out) + { + in + >> boost::tuples::get<0>(out); + } + + static void to_base(boost::tuple<T0> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in); + } +}; + +template <typename T0, typename T1> +struct type_conversion<boost::tuple<T0, T1> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out); + } + + static void to_base(boost::tuple<T0, T1> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in); + } +}; + +template <typename T0, typename T1, typename T2> +struct type_conversion<boost::tuple<T0, T1, T2> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1, T2> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out) + >> boost::tuples::get<2>(out); + } + + static void to_base(boost::tuple<T0, T1, T2> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in) + << boost::tuples::get<2>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3> +struct type_conversion<boost::tuple<T0, T1, T2, T3> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1, T2, T3> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out) + >> boost::tuples::get<2>(out) + >> boost::tuples::get<3>(out); + } + + static void to_base(boost::tuple<T0, T1, T2, T3> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in) + << boost::tuples::get<2>(in) + << boost::tuples::get<3>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4> +struct type_conversion<boost::tuple<T0, T1, T2, T3, T4> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1, T2, T3, T4> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out) + >> boost::tuples::get<2>(out) + >> boost::tuples::get<3>(out) + >> boost::tuples::get<4>(out); + } + + static void to_base(boost::tuple<T0, T1, T2, T3, T4> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in) + << boost::tuples::get<2>(in) + << boost::tuples::get<3>(in) + << boost::tuples::get<4>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5> +struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1, T2, T3, T4, T5> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out) + >> boost::tuples::get<2>(out) + >> boost::tuples::get<3>(out) + >> boost::tuples::get<4>(out) + >> boost::tuples::get<5>(out); + } + + static void to_base(boost::tuple<T0, T1, T2, T3, T4, T5> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in) + << boost::tuples::get<2>(in) + << boost::tuples::get<3>(in) + << boost::tuples::get<4>(in) + << boost::tuples::get<5>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6> +struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1, T2, T3, T4, T5, T6> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out) + >> boost::tuples::get<2>(out) + >> boost::tuples::get<3>(out) + >> boost::tuples::get<4>(out) + >> boost::tuples::get<5>(out) + >> boost::tuples::get<6>(out); + } + + static void to_base(boost::tuple<T0, T1, T2, T3, T4, T5, T6> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in) + << boost::tuples::get<2>(in) + << boost::tuples::get<3>(in) + << boost::tuples::get<4>(in) + << boost::tuples::get<5>(in) + << boost::tuples::get<6>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6, typename T7> +struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out) + >> boost::tuples::get<2>(out) + >> boost::tuples::get<3>(out) + >> boost::tuples::get<4>(out) + >> boost::tuples::get<5>(out) + >> boost::tuples::get<6>(out) + >> boost::tuples::get<7>(out); + } + + static void to_base(boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in) + << boost::tuples::get<2>(in) + << boost::tuples::get<3>(in) + << boost::tuples::get<4>(in) + << boost::tuples::get<5>(in) + << boost::tuples::get<6>(in) + << boost::tuples::get<7>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6, typename T7, typename T8> +struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out) + >> boost::tuples::get<2>(out) + >> boost::tuples::get<3>(out) + >> boost::tuples::get<4>(out) + >> boost::tuples::get<5>(out) + >> boost::tuples::get<6>(out) + >> boost::tuples::get<7>(out) + >> boost::tuples::get<8>(out); + } + + static void to_base(boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in) + << boost::tuples::get<2>(in) + << boost::tuples::get<3>(in) + << boost::tuples::get<4>(in) + << boost::tuples::get<5>(in) + << boost::tuples::get<6>(in) + << boost::tuples::get<7>(in) + << boost::tuples::get<8>(in); + } +}; + +template <typename T0, typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6, typename T7, typename T8, typename T9> +struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> > +{ + typedef values base_type; + + static void from_base(base_type const & in, indicator ind, + boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & out) + { + in + >> boost::tuples::get<0>(out) + >> boost::tuples::get<1>(out) + >> boost::tuples::get<2>(out) + >> boost::tuples::get<3>(out) + >> boost::tuples::get<4>(out) + >> boost::tuples::get<5>(out) + >> boost::tuples::get<6>(out) + >> boost::tuples::get<7>(out) + >> boost::tuples::get<8>(out) + >> boost::tuples::get<9>(out); + } + + static void to_base( + boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & in, + base_type & out, indicator & ind) + { + out + << boost::tuples::get<0>(in) + << boost::tuples::get<1>(in) + << boost::tuples::get<2>(in) + << boost::tuples::get<3>(in) + << boost::tuples::get<4>(in) + << boost::tuples::get<5>(in) + << boost::tuples::get<6>(in) + << boost::tuples::get<7>(in) + << boost::tuples::get<8>(in) + << boost::tuples::get<9>(in); + } +}; + +} // namespace soci + +#endif // SOCI_BOOST_TUPLE_H_INCLUDED diff --git a/src/core/connection-pool.cpp b/src/core/connection-pool.cpp new file mode 100644 index 00000000..f5e7557f --- /dev/null +++ b/src/core/connection-pool.cpp @@ -0,0 +1,325 @@ +// +// Copyright (C) 2008 Maciej Sobczak +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "connection-pool.h" +#include "error.h" +#include "session.h" +#include <vector> +#include <utility> + +#ifndef _WIN32 +// POSIX implementation + +#include <pthread.h> +#include <sys/time.h> +#include <errno.h> + +using namespace soci; + +struct connection_pool::connection_pool_impl +{ + bool find_free(std::size_t & pos) + { + for (std::size_t i = 0; i != sessions_.size(); ++i) + { + if (sessions_[i].first) + { + pos = i; + return true; + } + } + + return false; + } + + // by convention, first == true means the entry is free (not used) + std::vector<std::pair<bool, session *> > sessions_; + pthread_mutex_t mtx_; + pthread_cond_t cond_; +}; + +connection_pool::connection_pool(std::size_t size) +{ + if (size == 0) + { + throw soci_error("Invalid pool size"); + } + + pimpl_ = new connection_pool_impl(); + pimpl_->sessions_.resize(size); + for (std::size_t i = 0; i != size; ++i) + { + pimpl_->sessions_[i] = std::make_pair(true, new session()); + } + + int cc = pthread_mutex_init(&(pimpl_->mtx_), NULL); + if (cc != 0) + { + throw soci_error("Synchronization error"); + } + + cc = pthread_cond_init(&(pimpl_->cond_), NULL); + if (cc != 0) + { + throw soci_error("Synchronization error"); + } +} + +connection_pool::~connection_pool() +{ + for (std::size_t i = 0; i != pimpl_->sessions_.size(); ++i) + { + delete pimpl_->sessions_[i].second; + } + + pthread_mutex_destroy(&(pimpl_->mtx_)); + pthread_cond_destroy(&(pimpl_->cond_)); + + delete pimpl_; +} + +session & connection_pool::at(std::size_t pos) +{ + if (pos >= pimpl_->sessions_.size()) + { + throw soci_error("Invalid pool position"); + } + + return *(pimpl_->sessions_[pos].second); +} + +std::size_t connection_pool::lease() +{ + std::size_t pos; + + // no timeout + bool const success = try_lease(pos, -1); + assert(success); + + return pos; +} + +bool connection_pool::try_lease(std::size_t & pos, int timeout) +{ + struct timespec tm; + if (timeout >= 0) + { + // timeout is relative in milliseconds + + struct timeval tmv; + gettimeofday(&tmv, NULL); + + tm.tv_sec = tmv.tv_sec + timeout / 1000; + tm.tv_nsec = tmv.tv_usec * 1000 + (timeout % 1000) * 1000 * 1000; + } + + int cc = pthread_mutex_lock(&(pimpl_->mtx_)); + if (cc != 0) + { + throw soci_error("Synchronization error"); + } + + while (pimpl_->find_free(pos) == false) + { + if (timeout < 0) + { + // no timeout, allow unlimited blocking + cc = pthread_cond_wait(&(pimpl_->cond_), &(pimpl_->mtx_)); + } + else + { + // wait with timeout + cc = pthread_cond_timedwait( + &(pimpl_->cond_), &(pimpl_->mtx_), &tm); + } + + if (cc == ETIMEDOUT) + { + break; + } + } + + if (cc == 0) + { + pimpl_->sessions_[pos].first = false; + } + + pthread_mutex_unlock(&(pimpl_->mtx_)); + + return cc == 0; +} + +void connection_pool::give_back(std::size_t pos) +{ + if (pos >= pimpl_->sessions_.size()) + { + throw soci_error("Invalid pool position"); + } + + int cc = pthread_mutex_lock(&(pimpl_->mtx_)); + if (cc != 0) + { + throw soci_error("Synchronization error"); + } + + if (pimpl_->sessions_[pos].first) + { + pthread_mutex_unlock(&(pimpl_->mtx_)); + throw soci_error("Cannot release pool entry (already free)"); + } + + pimpl_->sessions_[pos].first = true; + + pthread_mutex_unlock(&(pimpl_->mtx_)); + + pthread_cond_signal(&(pimpl_->cond_)); +} + +#else +// Windows implementation + +#include <Windows.h> + +using namespace soci; + +struct connection_pool::connection_pool_impl +{ + bool find_free(std::size_t & pos) + { + for (std::size_t i = 0; i != sessions_.size(); ++i) + { + if (sessions_[i].first) + { + pos = i; + return true; + } + } + + return false; + } + + // by convention, first == true means the entry is free (not used) + std::vector<std::pair<bool, session *> > sessions_; + + CRITICAL_SECTION mtx_; + HANDLE sem_; +}; + +connection_pool::connection_pool(std::size_t size) +{ + if (size == 0) + { + throw soci_error("Invalid pool size"); + } + + pimpl_ = new connection_pool_impl(); + pimpl_->sessions_.resize(size); + for (std::size_t i = 0; i != size; ++i) + { + pimpl_->sessions_[i] = std::make_pair(true, new session()); + } + + InitializeCriticalSection(&(pimpl_->mtx_)); + + // initially all entries are available + HANDLE s = CreateSemaphore(NULL, + static_cast<LONG>(size), static_cast<LONG>(size), NULL); + if (s == NULL) + { + throw soci_error("Synchronization error"); + } + + pimpl_->sem_ = s; +} + +connection_pool::~connection_pool() +{ + for (std::size_t i = 0; i != pimpl_->sessions_.size(); ++i) + { + delete pimpl_->sessions_[i].second; + } + + DeleteCriticalSection(&(pimpl_->mtx_)); + CloseHandle(&(pimpl_->sem_)); + + delete pimpl_; +} + +session & connection_pool::at(std::size_t pos) +{ + if (pos >= pimpl_->sessions_.size()) + { + throw soci_error("Invalid pool position"); + } + + return *(pimpl_->sessions_[pos].second); +} + +std::size_t connection_pool::lease() +{ + std::size_t pos; + + // no timeout + bool const success = try_lease(pos, -1); + assert(success); + + return pos; +} + +bool connection_pool::try_lease(std::size_t & pos, int timeout) +{ + DWORD cc = WaitForSingleObject(&(pimpl_->sem_), + timeout >= 0 ? static_cast<DWORD>(timeout) : INFINITE); + if (cc == WAIT_OBJECT_0) + { + // semaphore acquired, there is (at least) one free entry + + EnterCriticalSection(&(pimpl_->mtx_)); + + bool const success = pimpl_->find_free(pos); + assert(success); + + pimpl_->sessions_[pos].first = false; + + LeaveCriticalSection(&(pimpl_->mtx_)); + + return true; + } + else if (cc == WAIT_TIMEOUT) + { + return false; + } + else + { + throw soci_error("Synchronization error"); + } +} + +void connection_pool::give_back(std::size_t pos) +{ + if (pos >= pimpl_->sessions_.size()) + { + throw soci_error("Invalid pool position"); + } + + EnterCriticalSection(&(pimpl_->mtx_)); + + if (pimpl_->sessions_[pos].first) + { + LeaveCriticalSection(&(pimpl_->mtx_)); + throw soci_error("Cannot release pool entry (already free)"); + } + + pimpl_->sessions_[pos].first = true; + + LeaveCriticalSection(&(pimpl_->mtx_)); + + ReleaseSemaphore(&(pimpl_->sem_), 1, NULL); +} + +#endif // _WIN32 diff --git a/src/core/connection-pool.h b/src/core/connection-pool.h new file mode 100644 index 00000000..722187d2 --- /dev/null +++ b/src/core/connection-pool.h @@ -0,0 +1,38 @@ +// +// Copyright (C) 2008 Maciej Sobczak +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_CONNECTION_POOL_H_INCLUDED +#define SOCI_CONNECTION_POOL_H_INCLUDED + +#include "soci-config.h" +#include <cstddef> + +namespace soci +{ + +class session; + +class SOCI_DECL connection_pool +{ +public: + explicit connection_pool(std::size_t size); + ~connection_pool(); + + session & at(std::size_t pos); + + std::size_t lease(); + bool try_lease(std::size_t & pos, int timeout); + void give_back(std::size_t pos); + +private: + struct connection_pool_impl; + connection_pool_impl * pimpl_; +}; + +} + +#endif // SOCI_CONNECTION_POOL_H_INCLUDED diff --git a/src/core/error.cpp b/src/core/error.cpp new file mode 100644 index 00000000..b16e2ca2 --- /dev/null +++ b/src/core/error.cpp @@ -0,0 +1,17 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE + +#include "error.h" + +using namespace soci; + +soci_error::soci_error(std::string const & msg) + : std::runtime_error(msg) +{ +} diff --git a/src/core/error.h b/src/core/error.h new file mode 100644 index 00000000..9ee8270e --- /dev/null +++ b/src/core/error.h @@ -0,0 +1,27 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_ERROR_H_INCLUDED +#define SOCI_ERROR_H_INCLUDED + +#include "soci-config.h" + +#include <stdexcept> +#include <string> + +namespace soci +{ + +class SOCI_DECL soci_error : public std::runtime_error +{ +public: + explicit soci_error(std::string const & msg); +}; + +} // namespace soci + +#endif // SOCI_ERROR_H_INCLUDED diff --git a/src/core/exchange-traits.h b/src/core/exchange-traits.h new file mode 100644 index 00000000..0e026ae8 --- /dev/null +++ b/src/core/exchange-traits.h @@ -0,0 +1,119 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_EXCHANGE_TRAITS_H_INCLUDED +#define SOCI_EXCHANGE_TRAITS_H_INCLUDED + +#include "type-conversion-traits.h" +#include "soci-backend.h" +#include <ctime> + +#include <vector> + +namespace soci +{ + +namespace details +{ + +struct basic_type_tag {}; +struct user_type_tag {}; + +template <typename T> +struct exchange_traits +{ + // this is used for tag-dispatch between implementations for basic types + // and user-defined types + typedef user_type_tag type_family; + + enum // anonymous + { + x_type = + exchange_traits<typename type_conversion<T>::base_type>::x_type + }; +}; + +template <> +struct exchange_traits<short> +{ + typedef basic_type_tag type_family; + enum { x_type = x_short }; +}; + +template <> +struct exchange_traits<int> +{ + typedef basic_type_tag type_family; + enum { x_type = x_integer }; +}; + +template <> +struct exchange_traits<char> +{ + typedef basic_type_tag type_family; + enum { x_type = x_char }; +}; + +template <> +struct exchange_traits<unsigned long> +{ + typedef basic_type_tag type_family; + enum { x_type = x_unsigned_long }; +}; + +template <> +struct exchange_traits<long long> +{ + typedef basic_type_tag type_family; + enum { x_type = x_long_long }; +}; + +template <> +struct exchange_traits<double> +{ + typedef basic_type_tag type_family; + enum { x_type = x_double }; +}; + +template <> +struct exchange_traits<char *> +{ + typedef basic_type_tag type_family; +}; + +template <std::size_t N> +struct exchange_traits<char[N]> +{ + typedef basic_type_tag type_family; +}; + +template <> +struct exchange_traits<std::string> +{ + typedef basic_type_tag type_family; + enum { x_type = x_stdstring }; +}; + +template <> +struct exchange_traits<std::tm> +{ + typedef basic_type_tag type_family; + enum { x_type = x_stdtm }; +}; + +template <typename T> +struct exchange_traits<std::vector<T> > +{ + typedef typename exchange_traits<T>::type_family type_family; + enum { x_type = exchange_traits<T>::x_type }; +}; + +} // namespace details + +} // namespace soci + +#endif // SOCI_EXCHANGE_TRAITS_H_INCLUDED diff --git a/src/core/into-type.cpp b/src/core/into-type.cpp new file mode 100644 index 00000000..15fb1a1d --- /dev/null +++ b/src/core/into-type.cpp @@ -0,0 +1,105 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "into-type.h" +#include "statement.h" + +using namespace soci; +using namespace soci::details; + +standard_into_type::~standard_into_type() +{ + delete backEnd_; +} + +void standard_into_type::define(statement_impl & st, int & position) +{ + backEnd_ = st.make_into_type_backend(); + backEnd_->define_by_pos(position, data_, type_); +} + +void standard_into_type::pre_fetch() +{ + backEnd_->pre_fetch(); +} + +void standard_into_type::post_fetch(bool gotData, bool calledFromFetch) +{ + backEnd_->post_fetch(gotData, calledFromFetch, ind_); + + if (gotData) + { + convert_from_base(); + } +} + +void standard_into_type::clean_up() +{ + // backEnd_ might be NULL if IntoType<Row> was used + if (backEnd_ != NULL) + { + backEnd_->clean_up(); + } +} + +vector_into_type::~vector_into_type() +{ + delete backEnd_; +} + +void vector_into_type::define(statement_impl & st, int & position) +{ + backEnd_ = st.make_vector_into_type_backend(); + backEnd_->define_by_pos(position, data_, type_); +} + +void vector_into_type::pre_fetch() +{ + backEnd_->pre_fetch(); +} + +void vector_into_type::post_fetch(bool gotData, bool /* calledFromFetch */) +{ + if (indVec_ != NULL && indVec_->empty() == false) + { + assert(indVec_->empty() == false); + backEnd_->post_fetch(gotData, &(*indVec_)[0]); + } + else + { + backEnd_->post_fetch(gotData, NULL); + } + + if (gotData) + { + convert_from_base(); + } +} + +void vector_into_type::resize(std::size_t sz) +{ + if (indVec_ != NULL) + { + indVec_->resize(sz); + } + + backEnd_->resize(sz); +} + +std::size_t vector_into_type::size() const +{ + return backEnd_->size(); +} + +void vector_into_type::clean_up() +{ + if (backEnd_ != NULL) + { + backEnd_->clean_up(); + } +} diff --git a/src/core/into-type.h b/src/core/into-type.h new file mode 100644 index 00000000..24979314 --- /dev/null +++ b/src/core/into-type.h @@ -0,0 +1,188 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_INTO_TYPE_H_INCLUDED +#define SOCI_INTO_TYPE_H_INCLUDED + +#include "soci-backend.h" +#include "type-ptr.h" +#include "exchange-traits.h" + +#include <string> +#include <vector> + +namespace soci +{ + +class session; + +namespace details +{ + +class prepare_temp_type; +class standard_into_type_backend; +class vector_into_type_backend; +class statement_impl; + +// this is intended to be a base class for all classes that deal with +// defining output data +class into_type_base +{ +public: + virtual ~into_type_base() {} + + virtual void define(statement_impl & st, int & position) = 0; + virtual void pre_fetch() = 0; + virtual void post_fetch(bool gotData, bool calledFromFetch) = 0; + virtual void clean_up() = 0; + + virtual std::size_t size() const = 0; // returns the number of elements + virtual void resize(std::size_t /* sz */) {} // used for vectors only +}; + +typedef type_ptr<into_type_base> into_type_ptr; + +// standard types + +class SOCI_DECL standard_into_type : public into_type_base +{ +public: + standard_into_type(void * data, exchange_type type) + : data_(data), type_(type), ind_(NULL), backEnd_(NULL) {} + standard_into_type(void * data, exchange_type type, indicator & ind) + : data_(data), type_(type), ind_(&ind), backEnd_(NULL) {} + + virtual ~standard_into_type(); + +protected: + virtual void post_fetch(bool gotData, bool calledFromFetch); + +private: + virtual void define(statement_impl & st, int & position); + virtual void pre_fetch(); + virtual void clean_up(); + + virtual std::size_t size() const { return 1; } + + // conversion hook (from base type to arbitrary user type) + virtual void convert_from_base() {} + + void * data_; + exchange_type type_; + indicator * ind_; + + standard_into_type_backend * backEnd_; +}; + +// into type base class for vectors +class SOCI_DECL vector_into_type : public into_type_base +{ +public: + vector_into_type(void * data, exchange_type type) + : data_(data), type_(type), indVec_(NULL), backEnd_(NULL) {} + + vector_into_type(void * data, exchange_type type, + std::vector<indicator> & ind) + : data_(data), type_(type), indVec_(&ind), backEnd_(NULL) {} + + ~vector_into_type(); + +protected: + virtual void post_fetch(bool gotData, bool calledFromFetch); + +private: + virtual void define(statement_impl & st, int & position); + virtual void pre_fetch(); + virtual void clean_up(); + virtual void resize(std::size_t sz); + virtual std::size_t size() const; + + void * data_; + exchange_type type_; + std::vector<indicator> * indVec_; + + vector_into_type_backend * backEnd_; + + virtual void convert_from_base() {} +}; + +// implementation for the basic types (those which are supported by the library +// out of the box without user-provided conversions) + +template <typename T> +class into_type : public standard_into_type +{ +public: + into_type(T & t) + : standard_into_type(&t, + static_cast<exchange_type>(exchange_traits<T>::x_type)) {} + into_type(T & t, indicator & ind) + : standard_into_type(&t, + static_cast<exchange_type>(exchange_traits<T>::x_type), ind) {} +}; + +template <typename T> +class into_type<std::vector<T> > : public vector_into_type +{ +public: + into_type(std::vector<T> & v) + : vector_into_type(&v, + static_cast<exchange_type>(exchange_traits<T>::x_type)) {} + into_type(std::vector<T> & v, std::vector<indicator> & ind) + : vector_into_type(&v, + static_cast<exchange_type>(exchange_traits<T>::x_type), ind) {} +}; + +// special cases for char* and char[] + +template <> +class into_type<char *> : public standard_into_type +{ +public: + into_type(char * str, std::size_t bufSize) + : standard_into_type(&str_, x_cstring), str_(str, bufSize) {} + into_type(char * str, indicator & ind, std::size_t bufSize) + : standard_into_type(&str_, x_cstring, ind), str_(str, bufSize) {} + +private: + cstring_descriptor str_; +}; + +template <std::size_t N> +class into_type<char[N]> : public into_type<char *> +{ +public: + into_type(char str[]) : into_type<char *>(str, N) {} + into_type(char str[], indicator & ind) + : into_type<char *>(str, ind, N) {} +}; + +// helper dispatchers for basic types + +template <typename T> +into_type_ptr do_into(T & t, basic_type_tag) +{ + return into_type_ptr(new into_type<T>(t)); +} + +template <typename T> +into_type_ptr do_into(T & t, indicator & ind, basic_type_tag) +{ + return into_type_ptr(new into_type<T>(t, ind)); +} + +template <typename T> +into_type_ptr do_into(T & t, std::vector<indicator> & ind, basic_type_tag) +{ + return into_type_ptr(new into_type<T>(t, ind)); +} + +} // namespace details + +} // namespace SOCI + +#endif // SOCI_INTO_TYPE_H_INCLUDED diff --git a/src/core/into.h b/src/core/into.h new file mode 100644 index 00000000..306342f2 --- /dev/null +++ b/src/core/into.h @@ -0,0 +1,52 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_INTO_H_INCLUDED +#define SOCI_INTO_H_INCLUDED + +#include "into-type.h" +#include "exchange-traits.h" +#include "type-conversion.h" + +namespace soci +{ + +// the into function is a helper for defining output variables +// these helpers work with both basic and user-defined types thanks to +// the tag-dispatching, as defined in exchange_traits template + +template <typename T> +details::into_type_ptr into(T & t) +{ + return details::do_into(t, + typename details::exchange_traits<T>::type_family()); +} + +template <typename T> +details::into_type_ptr into(T & t, indicator & ind) +{ + return details::do_into(t, ind, + typename details::exchange_traits<T>::type_family()); +} + +template <typename T> +details::into_type_ptr into(T & t, std::vector<indicator> & ind) +{ + return details::do_into(t, ind, + typename details::exchange_traits<T>::type_family()); +} + +// for char buffer with run-time size information +template <typename T> +details::into_type_ptr into(T & t, std::size_t bufSize) +{ + return details::into_type_ptr(new details::into_type<T>(t, bufSize)); +} + +} // namespace soci + +#endif // SOCI_INTO_H_INCLUDED diff --git a/src/core/once-temp-type.cpp b/src/core/once-temp-type.cpp new file mode 100644 index 00000000..ad01ed2f --- /dev/null +++ b/src/core/once-temp-type.cpp @@ -0,0 +1,53 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "once-temp-type.h" +#include "ref-counted-statement.h" +#include "session.h" + +using namespace soci; +using namespace soci::details; + +once_temp_type::once_temp_type(session & s) + : rcst_(new ref_counted_statement(s)) +{ + // this is the beginning of new query + s.get_query_stream().str(""); +} + +once_temp_type::once_temp_type(once_temp_type const & o) + :rcst_(o.rcst_) +{ + rcst_->inc_ref(); +} + +once_temp_type & once_temp_type::operator=(once_temp_type const & o) +{ + o.rcst_->inc_ref(); + rcst_->dec_ref(); + rcst_ = o.rcst_; + + return *this; +} + +once_temp_type::~once_temp_type() +{ + rcst_->dec_ref(); +} + +once_temp_type & once_temp_type::operator,(into_type_ptr const & i) +{ + rcst_->exchange(i); + return *this; +} + +once_temp_type & once_temp_type::operator,(use_type_ptr const & u) +{ + rcst_->exchange(u); + return *this; +} diff --git a/src/core/once-temp-type.h b/src/core/once-temp-type.h new file mode 100644 index 00000000..ff446695 --- /dev/null +++ b/src/core/once-temp-type.h @@ -0,0 +1,102 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_ONCE_TEMP_TYPE_H_INCLUDED +#define SOCI_ONCE_TEMP_TYPE_H_INCLUDED + +#include "ref-counted-statement.h" +#include "prepare-temp-type.h" + +namespace soci +{ + +class session; + +namespace details +{ + +class ref_counted_statement; + +// this needs to be lightweight and copyable +class SOCI_DECL once_temp_type +{ +public: + + once_temp_type(session & s); + once_temp_type(once_temp_type const & o); + once_temp_type & operator=(once_temp_type const & o); + + ~once_temp_type(); + + template <typename T> + once_temp_type & operator<<(T const & t) + { + rcst_->accumulate(t); + return *this; + } + + once_temp_type & operator,(into_type_ptr const &); + once_temp_type & operator,(use_type_ptr const &); + +private: + ref_counted_statement * rcst_; +}; + +// this needs to be lightweight and copyable +class once_type +{ +public: + once_type() : session_(NULL) {} + once_type(session * s) : session_(s) {} + + void set_session(session * s) + { + session_ = s; + } + + template <typename T> + once_temp_type operator<<(T const & t) + { + once_temp_type o(*session_); + o << t; + return o; + } + +private: + session * session_; +}; + + +// this needs to be lightweight and copyable +class prepare_type +{ +public: + prepare_type() : session_(NULL) {} + prepare_type(session * s) : session_(s) {} + + void set_session(session * s) + { + session_ = s; + } + + template <typename T> + prepare_temp_type operator<<(T const & t) + { + prepare_temp_type p(*session_); + p << t; + return p; + } + +private: + session * session_; +}; + +} // namespace details + +} // namespace soci + +#endif diff --git a/src/core/prepare-temp-type.cpp b/src/core/prepare-temp-type.cpp new file mode 100644 index 00000000..4631bb38 --- /dev/null +++ b/src/core/prepare-temp-type.cpp @@ -0,0 +1,53 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "prepare-temp-type.h" +#include "ref-counted-prepare-info.h" +#include "session.h" + +using namespace soci; +using namespace soci::details; + +prepare_temp_type::prepare_temp_type(session & s) + : rcpi_(new ref_counted_prepare_info(s)) +{ + // this is the beginning of new query + s.get_query_stream().str(""); +} + +prepare_temp_type::prepare_temp_type(prepare_temp_type const & o) + :rcpi_(o.rcpi_) +{ + rcpi_->inc_ref(); +} + +prepare_temp_type & prepare_temp_type::operator=(prepare_temp_type const & o) +{ + o.rcpi_->inc_ref(); + rcpi_->dec_ref(); + rcpi_ = o.rcpi_; + + return *this; +} + +prepare_temp_type::~prepare_temp_type() +{ + rcpi_->dec_ref(); +} + +prepare_temp_type & prepare_temp_type::operator,(into_type_ptr const & i) +{ + rcpi_->exchange(i); + return *this; +} + +prepare_temp_type & prepare_temp_type::operator,(use_type_ptr const & u) +{ + rcpi_->exchange(u); + return *this; +} diff --git a/src/core/prepare-temp-type.h b/src/core/prepare-temp-type.h new file mode 100644 index 00000000..c3d8a017 --- /dev/null +++ b/src/core/prepare-temp-type.h @@ -0,0 +1,51 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_PREPARE_TEMP_TYPE_INCLUDED +#define SOCI_PREPARE_TEMP_TYPE_INCLUDED + +#include "into-type.h" +#include "use-type.h" +#include "ref-counted-prepare-info.h" + +namespace soci +{ + +namespace details +{ + +// this needs to be lightweight and copyable +class SOCI_DECL prepare_temp_type +{ +public: + prepare_temp_type(session &); + prepare_temp_type(prepare_temp_type const &); + prepare_temp_type & operator=(prepare_temp_type const &); + + ~prepare_temp_type(); + + template <typename T> + prepare_temp_type & operator<<(T const & t) + { + rcpi_->accumulate(t); + return *this; + } + + prepare_temp_type & operator,(into_type_ptr const & i); + prepare_temp_type & operator,(use_type_ptr const & u); + + ref_counted_prepare_info * get_prepare_info() const { return rcpi_; } + +private: + ref_counted_prepare_info * rcpi_; +}; + +} // namespace details + +} // namespace soci + +#endif diff --git a/src/core/procedure.cpp b/src/core/procedure.cpp new file mode 100644 index 00000000..59f8d7a9 --- /dev/null +++ b/src/core/procedure.cpp @@ -0,0 +1,33 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "procedure.h" +#include "statement.h" +#include "prepare-temp-type.h" + +using namespace soci; +using namespace soci::details; + +procedure_impl::procedure_impl(prepare_temp_type const & prep) + : statement_impl(prep.get_prepare_info()->session_), + refCount_(1) +{ + ref_counted_prepare_info * prepInfo = prep.get_prepare_info(); + + // take all bind/define info + intos_.swap(prepInfo->intos_); + uses_.swap(prepInfo->uses_); + + // allocate handle + alloc(); + + // prepare the statement + prepare(rewrite_for_procedure_call(prepInfo->get_query())); + + define_and_bind(); +} diff --git a/src/core/procedure.h b/src/core/procedure.h new file mode 100644 index 00000000..92a4396e --- /dev/null +++ b/src/core/procedure.h @@ -0,0 +1,89 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_PROCEDURE_H_INCLUDED +#define SOCI_PROCEDURE_H_INCLUDED + +#include "statement.h" + +namespace soci +{ + +namespace details +{ + +class SOCI_DECL procedure_impl : public statement_impl +{ +public: + procedure_impl(session & s) : statement_impl(s), refCount_(1) {} + procedure_impl(prepare_temp_type const & prep); + + void inc_ref() { ++refCount_; } + void dec_ref() + { + if (--refCount_ == 0) + { + delete this; + } + } + +private: + int refCount_; +}; + +} // namespace details + +class SOCI_DECL procedure +{ +public: + // this is a conversion constructor + procedure(details::prepare_temp_type const & prep) + : impl_(new details::procedure_impl(prep)) {} + + ~procedure() { impl_->dec_ref(); } + + // copy is supported here + procedure(procedure const & other) + : impl_(other.impl_) + { + impl_->inc_ref(); + } + void operator=(procedure const & other) + { + other.impl_->inc_ref(); + impl_->dec_ref(); + impl_ = other.impl_; + } + + // forwarders to procedure_impl + // (or rather to its base interface from statement_impl) + + bool execute(bool withDataExchange = false) + { + gotData_ = impl_->execute(withDataExchange); + return gotData_; + } + + bool fetch() + { + gotData_ = impl_->fetch(); + return gotData_; + } + + bool got_data() const + { + return gotData_; + } + +private: + details::procedure_impl * impl_; + bool gotData_; +}; + +} // namespace soci + +#endif diff --git a/src/core/ref-counted-prepare-info.cpp b/src/core/ref-counted-prepare-info.cpp new file mode 100644 index 00000000..3196c94d --- /dev/null +++ b/src/core/ref-counted-prepare-info.cpp @@ -0,0 +1,46 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "ref-counted-prepare-info.h" +#include "session.h" + +using namespace soci; +using namespace soci::details; + +void ref_counted_prepare_info::exchange(into_type_ptr const & i) +{ + intos_.push_back(i.get()); + i.release(); +} + +void ref_counted_prepare_info::exchange(use_type_ptr const & u) +{ + uses_.push_back(u.get()); + u.release(); +} + +void ref_counted_prepare_info::final_action() +{ + // deallocate all bind and define objects + for (std::size_t i = intos_.size(); i > 0; --i) + { + delete intos_[i - 1]; + intos_.resize(i - 1); + } + + for (std::size_t i = uses_.size(); i > 0; --i) + { + delete uses_[i - 1]; + uses_.resize(i - 1); + } +} + +std::string ref_counted_prepare_info::get_query() const +{ + return session_.get_query_stream().str(); +} diff --git a/src/core/ref-counted-prepare-info.h b/src/core/ref-counted-prepare-info.h new file mode 100644 index 00000000..d1b95321 --- /dev/null +++ b/src/core/ref-counted-prepare-info.h @@ -0,0 +1,56 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_REF_COUNTED_PREPARE_INFO_INCLUDED +#define SOCI_REF_COUNTED_PREPARE_INFO_INCLUDED + +#include "ref-counted-statement.h" + +#include <vector> + +namespace soci +{ + +class session; + +namespace details +{ + +class procedure_impl; +class statement_impl; +class into_type_base; + +// this class conveys only the statement text and the bind/define info +// it exists only to be passed to statement's constructor +class ref_counted_prepare_info : public ref_counted_statement_base +{ +public: + ref_counted_prepare_info(session & s) + : ref_counted_statement_base(s), session_(s) {} + + void exchange(into_type_ptr const & i); + void exchange(use_type_ptr const & u); + + virtual void final_action(); + +private: + friend class statement_impl; + friend class procedure_impl; + + session & session_; + + std::vector<into_type_base *> intos_; + std::vector<use_type_base *> uses_; + + std::string get_query() const; +}; + +} // namespace details + +} // namespace soci + +#endif diff --git a/src/core/ref-counted-statement.cpp b/src/core/ref-counted-statement.cpp new file mode 100644 index 00000000..fa49a5bc --- /dev/null +++ b/src/core/ref-counted-statement.cpp @@ -0,0 +1,38 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "ref-counted-statement.h" +#include "session.h" + +using namespace soci; +using namespace soci::details; + +void ref_counted_statement::final_action() +{ + try + { + st_.alloc(); + st_.prepare(session_.get_query_stream().str(), st_one_time_query); + st_.define_and_bind(); + + const bool gotData = st_.execute(true); + session_.set_got_data(gotData); + } + catch (...) + { + st_.clean_up(); + throw; + } + + st_.clean_up(); +} + +std::ostringstream & ref_counted_statement_base::get_query_stream() +{ + return session_.get_query_stream(); +} diff --git a/src/core/ref-counted-statement.h b/src/core/ref-counted-statement.h new file mode 100644 index 00000000..c2ced22e --- /dev/null +++ b/src/core/ref-counted-statement.h @@ -0,0 +1,86 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_REF_COUNTED_STATEMENT_H_INCLUDED +#define SOCI_REF_COUNTED_STATEMENT_H_INCLUDED + +#include "statement.h" +#include "into-type.h" +#include "use-type.h" + +namespace soci +{ + +namespace details +{ + +// this class is a base for both "once" and "prepare" statements +class SOCI_DECL ref_counted_statement_base +{ +public: + ref_counted_statement_base(session & s) : refCount_(1), session_(s) {} + virtual ~ref_counted_statement_base() {} + + virtual void final_action() = 0; + + void inc_ref() { ++refCount_; } + void dec_ref() + { + if (--refCount_ == 0) + { + try + { + final_action(); + } + catch (...) + { + delete this; + throw; + } + + delete this; + } + } + + template <typename T> + void accumulate(T const & t) { get_query_stream() << t; } + +protected: + ref_counted_statement_base(ref_counted_statement_base const &); + ref_counted_statement_base & operator=(ref_counted_statement_base const &); + + // this function allows to break the circular dependenc + // between session and this class + std::ostringstream & get_query_stream(); + + int refCount_; + + session & session_; +}; + +// this class is supposed to be a vehicle for the "once" statements +// it executes the whole statement in its destructor +class ref_counted_statement : public ref_counted_statement_base +{ +public: + ref_counted_statement(session & s) + : ref_counted_statement_base(s), st_(s) {} + + void exchange(into_type_ptr const & i) { st_.exchange(i); } + void exchange(use_type_ptr const & u) { st_.exchange(u); } + + virtual void final_action(); + +private: + statement st_; +}; + +} // namespace details + +} // namespace soci + +#endif diff --git a/src/core/row-exchange.h b/src/core/row-exchange.h new file mode 100644 index 00000000..a5ec4988 --- /dev/null +++ b/src/core/row-exchange.h @@ -0,0 +1,75 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_INTO_ROW_H_INCLUDED +#define SOCI_INTO_ROW_H_INCLUDED + +#include "into-type.h" +#include "exchange-traits.h" +#include "row.h" +#include "statement.h" + +namespace soci +{ + +namespace details +{ + +// Support selecting into a row for dynamic queries + +template <> +class into_type<row> + : public into_type_base // bypass the standard_into_type +{ +public: + into_type(row & r) : r_(r) {} + into_type(row & r, indicator & ind) : r_(r) {} + +private: + // special handling for Row + virtual void define(statement_impl & st, int & /* position */) + { + st.set_row(&r_); + + // actual row description is performed + // as part of the statement execute + } + + virtual void pre_fetch() {} + virtual void post_fetch(bool gotData, bool /* calledFromFetch */) + { + r_.reset_get_counter(); + + if (gotData) + { + // this is used only to re-dispatch to derived class, if any + // (the derived class might be generated automatically by + // user conversions) + convert_from_base(); + } + } + + virtual void clean_up() {} + + virtual std::size_t size() const { return 1; } + + virtual void convert_from_base() {} + + row & r_; +}; + +template <> +struct exchange_traits<row> +{ + typedef basic_type_tag type_family; +}; + +} // namespace details + +} // namespace soci + +#endif diff --git a/src/core/row.cpp b/src/core/row.cpp new file mode 100644 index 00000000..e0eaaf74 --- /dev/null +++ b/src/core/row.cpp @@ -0,0 +1,101 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "row.h" + +#include <cctype> +#include <sstream> + +using namespace soci; +using namespace details; + +void row::add_properties(column_properties const &cp) +{ + columns_.push_back(cp); + + std::string columnName; + std::string const & originalName = cp.get_name(); + if (uppercaseColumnNames_) + { + for (std::size_t i = 0; i != originalName.size(); ++i) + { + columnName.push_back(std::toupper(originalName[i])); + } + + // rewrite the column name in the column_properties object + // as well to retain consistent views + + columns_[columns_.size() - 1].set_name(columnName); + } + else + { + columnName = originalName; + } + + index_[columnName] = columns_.size() - 1; +} + +std::size_t row::size() const +{ + return holders_.size(); +} + +void row::clean_up() +{ + std::size_t const hsize = holders_.size(); + for (std::size_t i = 0; i != hsize; ++i) + { + delete holders_[i]; + delete indicators_[i]; + } + + columns_.clear(); + holders_.clear(); + indicators_.clear(); + index_.clear(); +} + +indicator row::get_indicator(std::size_t pos) const +{ + assert(indicators_.size() >= static_cast<std::size_t>(pos + 1)); + return *indicators_[pos]; +} + +indicator row::get_indicator(std::string const &name) const +{ + return get_indicator(find_column(name)); +} + +column_properties const & row::get_properties(std::size_t pos) const +{ + assert(columns_.size() >= pos + 1); + return columns_[pos]; +} + +column_properties const & row::get_properties(std::string const &name) const +{ + return get_properties(find_column(name)); +} + +std::size_t row::find_column(std::string const &name) const +{ + std::map<std::string, std::size_t>::const_iterator it = index_.find(name); + if (it == index_.end()) + { + std::ostringstream msg; + msg << "Column '" << name << "' not found"; + throw soci_error(msg.str()); + } + + return it->second; +} + +row::~row() +{ + clean_up(); +} diff --git a/src/core/row.h b/src/core/row.h new file mode 100644 index 00000000..c36dac8a --- /dev/null +++ b/src/core/row.h @@ -0,0 +1,153 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_ROW_H_INCLUDED +#define SOCI_ROW_H_INCLUDED + +#include "type-holder.h" +#include "soci-backend.h" +#include "type-conversion.h" + +#include <cassert> +#include <string> +#include <vector> +#include <map> + +namespace soci +{ + +class SOCI_DECL column_properties +{ + // use getters/setters in case we want to make some + // of the getters lazy in the future +public: + + std::string get_name() const { return name_; } + data_type get_data_type() const { return dataType_; } + + void set_name(std::string const &name) { name_ = name; } + void set_data_type(data_type dataType) { dataType_ = dataType; } + +private: + std::string name_; + data_type dataType_; +}; + +class SOCI_DECL row +{ +public: + void uppercase_column_names(bool forceToUpper) + { uppercaseColumnNames_ = forceToUpper; } + + void add_properties(column_properties const &cp); + std::size_t size() const; + void clean_up(); + + indicator get_indicator(std::size_t pos) const; + indicator get_indicator(std::string const &name) const; + + template <typename T> + inline void add_holder(T* t, indicator* ind) + { + holders_.push_back(new details::type_holder<T>(t)); + indicators_.push_back(ind); + } + + column_properties const & get_properties (std::size_t pos) const; + column_properties const & get_properties (std::string const &name) const; + + template <typename T> + T get(std::size_t pos) const + { + typedef typename type_conversion<T>::base_type BASE_TYPE; + + assert(holders_.size() >= pos + 1); + + const BASE_TYPE &baseVal = holders_[pos]->get<BASE_TYPE>(); + + T ret; + + type_conversion<T>::from_base(baseVal, *indicators_[pos], ret); + + return ret; + } + + template <typename T> + T get(std::size_t pos, T const &nullValue) const + { + assert(holders_.size() >= pos + 1); + + if (i_null == *indicators_[pos]) + { + return nullValue; + } + + return get<T>(pos); + } + + template <typename T> + T get(std::string const &name) const + { + std::size_t pos = find_column(name); + + return get<T>(pos); + } + + template <typename T> + T get(std::string const &name, T const &nullValue) const + { + std::size_t pos = find_column(name); + + if (i_null == *indicators_[pos]) + { + return nullValue; + } + + return get<T>(pos); + } + + template <typename T> + row const & operator>>(T &value) const + { + value = get<T>(currentPos_); + ++currentPos_; + return *this; + } + + void skip(std::size_t num = 1) const + { + currentPos_ += num; + } + + void reset_get_counter() const + { + currentPos_ = 0; + } + + row() : uppercaseColumnNames_(false), currentPos_(0) {} + ~row(); + +private: + // copy not supported + row(row const &); + void operator=(row const &); + + std::size_t find_column(std::string const &name) const; + + std::vector<column_properties> columns_; + std::vector<details::holder*> holders_; + std::vector<indicator*> indicators_; + std::map<std::string, std::size_t> index_; + + bool uppercaseColumnNames_; + + mutable std::size_t currentPos_; +}; + +} // namespace soci + +#endif // SOCI_ROW_H_INCLUDED diff --git a/src/core/rowid-exchange.h b/src/core/rowid-exchange.h new file mode 100644 index 00000000..4ae63107 --- /dev/null +++ b/src/core/rowid-exchange.h @@ -0,0 +1,57 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_ROWID_EXCHANGE_H_INCLUDED +#define SOCI_ROWID_EXCHANGE_H_INCLUDED + +#include "rowid.h" +#include "into-type.h" +#include "use-type.h" +#include "exchange-traits.h" + +namespace soci +{ + +namespace details +{ + +template <> +class use_type<rowid> : public standard_use_type +{ +public: + use_type(rowid & rid, std::string const & name = std::string()) + : standard_use_type(&rid, x_rowid, false, name) {} + use_type(rowid const & rid, std::string const & name = std::string()) + : standard_use_type(const_cast<rowid *>(&rid), x_rowid, true, name) {} + use_type(rowid & rid, indicator & ind, + std::string const & name = std::string()) + : standard_use_type(&rid, x_rowid, ind, false, name) {} + use_type(rowid const & rid, indicator & ind, + std::string const & name = std::string()) + : standard_use_type(const_cast<rowid *>(&rid), x_rowid, ind, true, name) {} +}; + +template <> +class into_type<rowid> : public standard_into_type +{ +public: + into_type(rowid & rid) : standard_into_type(&rid, x_rowid) {} + into_type(rowid & rid, indicator & ind) + :standard_into_type(&rid, x_rowid, ind) {} +}; + +template <> +struct exchange_traits<soci::rowid> +{ + typedef basic_type_tag type_family; +}; + +} // namespace details + +} // namespace soci + +#endif // SOCI_ROWID_EXCHANGE_H_INCLUDED diff --git a/src/core/rowid.cpp b/src/core/rowid.cpp new file mode 100644 index 00000000..5f64244a --- /dev/null +++ b/src/core/rowid.cpp @@ -0,0 +1,23 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "rowid.h" +#include "session.h" + +using namespace soci; +using namespace soci::details; + +rowid::rowid(session & s) +{ + backEnd_ = s.make_rowid_backend(); +} + +rowid::~rowid() +{ + delete backEnd_; +} diff --git a/src/core/rowid.h b/src/core/rowid.h new file mode 100644 index 00000000..78685cdc --- /dev/null +++ b/src/core/rowid.h @@ -0,0 +1,41 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_ROWID_H_INCLUDED +#define SOCI_ROWID_H_INCLUDED + +#include "soci-config.h" + +namespace soci +{ + +class session; + +namespace details +{ + +class rowid_backend; + +} // namespace details + +// ROWID support + +class SOCI_DECL rowid +{ +public: + explicit rowid(session & s); + ~rowid(); + + details::rowid_backend * get_backend() { return backEnd_; } + +private: + details::rowid_backend *backEnd_; +}; + +} // namespace soci + +#endif diff --git a/src/core/rowset.h b/src/core/rowset.h new file mode 100644 index 00000000..21a18216 --- /dev/null +++ b/src/core/rowset.h @@ -0,0 +1,241 @@ +// +// Copyright (C) 2006-2008 Mateusz Loskot +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_ROWSET_H_INCLUDED +#define SOCI_ROWSET_H_INCLUDED + +#include "statement.h" +#include <memory> + +namespace soci +{ + +// +// rowset iterator of input category. +// +template <typename T> +class rowset_iterator +{ +public: + + // Standard iterator traits + + typedef std::input_iterator_tag iterator_category; + typedef T value_type; + typedef T * pointer; + typedef T & reference; + typedef ptrdiff_t difference_type; + + // Constructors + + rowset_iterator() + : st_(0), define_(0) + {} + + rowset_iterator(statement & st, T & define) + : st_(&st), define_(&define) + { + assert(0 != st_); + assert(0 != define_); + assert(0 != st_->get_backend()); + + // Fetch first row to properly initialize iterator + ++(*this); + } + + // Access operators + + reference operator*() const + { + return (*define_); + } + + pointer operator->() const + { + return &(operator*()); + } + + // Iteration operators + + rowset_iterator & operator++() + { + // Fetch next row from dataset + + if (st_->fetch() == false) + { + // Set iterator to non-derefencable state (pass-the-end) + st_ = 0; + define_ = 0; + } + + return (*this); + } + + rowset_iterator operator++(int) + { + rowset_iterator tmp(*this); + ++(*this); + return tmp; + } + + // Comparison operators + + bool operator==(rowset_iterator const & rhs) const + { + return (st_== rhs.st_ && define_ == rhs.define_); + } + + bool operator!=(rowset_iterator const & rhs) const + { + return ((*this == rhs) == false); + } + +private: + + statement * st_; + T * define_; + +}; // class rowset_iterator + +namespace details +{ + +// +// Implementation of rowset +// +template <typename T> +class rowset_impl +{ +public: + + typedef rowset_iterator<T> iterator; + + rowset_impl(details::prepare_temp_type const & prep) + : refs_(1), st_(new statement(prep)), define_(new T()) + { + assert(0 != st_.get()); + assert(0 != define_.get()); + + st_->exchange_for_rowset(into(*define_)); + st_->execute(); + } + + void incRef() + { + ++refs_; + } + + void decRef() + { + if (--refs_ == 0) + { + delete this; + } + } + + iterator begin() const + { + // No ownership transfer occurs here + return iterator(*st_, *define_); + } + + iterator end() const + { + return iterator(); + } + +private: + + unsigned int refs_; + + const std::auto_ptr<statement> st_; + const std::auto_ptr<T> define_; + + // Non-copyable + rowset_impl(rowset_impl const &); + rowset_impl & operator=(rowset_impl const &); + +}; // class rowset_impl + +} // namespace details + + +// +// rowset is a thin wrapper on statement and provides access to STL-like input iterator. +// The rowset_iterator can be used to easily loop through statement results and +// use STL algorithms accepting input iterators. +// +template <typename T = soci::row> +class rowset +{ +public: + + typedef T value_type; + typedef rowset_iterator<T> iterator; + typedef rowset_iterator<T> const_iterator; + + // this is a conversion constructor + rowset(details::prepare_temp_type const & prep) + : pimpl_(new details::rowset_impl<T>(prep)) + { + assert(0 != pimpl_); + } + + rowset(rowset const & other) + : pimpl_(other.pimpl_) + { + assert(0 != pimpl_); + + pimpl_->incRef(); + } + + ~rowset() + { + assert(0 != pimpl_); + + pimpl_->decRef(); + } + + rowset& operator=(rowset const & rhs) + { + assert(0 != pimpl_); + assert(0 != rhs.pimpl_); + + rhs.incRef(); + pimpl_->decRef(); + pimpl_= rhs.pimpl_; + } + + const_iterator begin() const + { + assert(0 != pimpl_); + + return pimpl_->begin(); + } + + const_iterator end() const + { + assert(0 != pimpl_); + + return pimpl_->end(); + } + + bool empty() const + { + return (pimpl_->begin() == pimpl_->end()); + } + +private: + + // Pointer to implementation - the body + details::rowset_impl<T> * pimpl_; + +}; // class rowset + +} // namespace SOCI + +#endif diff --git a/src/core/session.cpp b/src/core/session.cpp new file mode 100644 index 00000000..ee20c71b --- /dev/null +++ b/src/core/session.cpp @@ -0,0 +1,377 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "session.h" +#include "connection-pool.h" +#include "soci-backend.h" +#include "backend-loader.h" + +#ifdef _MSC_VER +#pragma warning(disable:4355) +#endif + +using namespace soci; +using namespace soci::details; + +namespace // anonymous +{ + +void parseConnectString(std::string const & connectString, + std::string & backendName, + std::string & connectionParameters) +{ + std::string const protocolSeparator = "://"; + + std::string::size_type const p = connectString.find(protocolSeparator); + if (p == std::string::npos) + { + throw soci_error("No backend name found in " + connectString); + } + + backendName = connectString.substr(0, p); + connectionParameters = connectString.substr(p + protocolSeparator.size()); +} + +void ensureConnected(session_backend * backEnd) +{ + if (backEnd == NULL) + { + throw soci_error("Session is not connected."); + } +} + +} // namespace anonymous + +session::session() + : once(this), prepare(this), logStream_(NULL), + lastFactory_(NULL), uppercaseColumnNames_(false), backEnd_(NULL), + isFromPool_(false), pool_(NULL) +{ +} + +session::session(backend_factory const & factory, + std::string const & connectString) + : once(this), prepare(this), logStream_(NULL), + lastFactory_(&factory), lastConnectString_(connectString), + uppercaseColumnNames_(false), + isFromPool_(false), pool_(NULL) +{ + backEnd_ = factory.make_session(connectString); +} + +session::session(std::string const & backendName, + std::string const & connectString) + : once(this), prepare(this), logStream_(NULL), + uppercaseColumnNames_(false), + isFromPool_(false), pool_(NULL) +{ + backend_factory const & factory = dynamic_backends::get(backendName); + + lastFactory_ = &factory; + lastConnectString_ = connectString; + + backEnd_ = factory.make_session(connectString); +} + +session::session(std::string const & connectString) + : once(this), prepare(this), logStream_(NULL), + uppercaseColumnNames_(false), + isFromPool_(false), pool_(NULL) +{ + std::string backendName; + std::string connectionParameters; + + parseConnectString(connectString, backendName, connectionParameters); + + backend_factory const & factory = dynamic_backends::get(backendName); + + lastFactory_ = &factory; + lastConnectString_ = connectionParameters; + + backEnd_ = factory.make_session(connectionParameters); +} + +session::session(connection_pool & pool) + : isFromPool_(true), pool_(&pool) +{ + poolPosition_ = pool.lease(); + session & pooledSession = pool.at(poolPosition_); + + once.set_session(&pooledSession); + prepare.set_session(&pooledSession); + backEnd_ = pooledSession.get_backend(); +} + +session::~session() +{ + if (isFromPool_) + { + pool_->give_back(poolPosition_); + } + else + { + delete backEnd_; + } +} + +void session::open(backend_factory const & factory, + std::string const & connectString) +{ + if (isFromPool_) + { + pool_->at(poolPosition_).open(factory, connectString); + } + else + { + if (backEnd_ != NULL) + { + throw soci_error("Cannot open already connected session."); + } + + backEnd_ = factory.make_session(connectString); + lastFactory_ = &factory; + lastConnectString_ = connectString; + } +} + +void session::open(std::string const & backendName, + std::string const & connectString) +{ + if (isFromPool_) + { + pool_->at(poolPosition_).open(backendName, connectString); + } + else + { + if (backEnd_ != NULL) + { + throw soci_error("Cannot open already connected session."); + } + + backend_factory const & factory = dynamic_backends::get(backendName); + + backEnd_ = factory.make_session(connectString); + lastFactory_ = &factory; + lastConnectString_ = connectString; + } +} + +void session::open(std::string const & connectString) +{ + if (isFromPool_) + { + pool_->at(poolPosition_).open(connectString); + } + else + { + if (backEnd_ != NULL) + { + throw soci_error("Cannot open already connected session."); + } + + std::string backendName; + std::string connectionParameters; + + parseConnectString(connectString, backendName, connectionParameters); + + backend_factory const & factory = dynamic_backends::get(backendName); + + backEnd_ = factory.make_session(connectionParameters); + lastFactory_ = &factory; + lastConnectString_ = connectionParameters; + } +} + +void session::close() +{ + if (isFromPool_) + { + pool_->at(poolPosition_).close(); + } + else + { + delete backEnd_; + backEnd_ = NULL; + } +} + +void session::reconnect() +{ + if (isFromPool_) + { + pool_->at(poolPosition_).reconnect(); + } + else + { + if (lastFactory_ == NULL) + { + throw soci_error("Cannot reconnect without previous connection."); + } + + if (backEnd_ != NULL) + { + close(); + } + + backEnd_ = lastFactory_->make_session(lastConnectString_); + } +} + +void session::begin() +{ + backEnd_->begin(); +} + +void session::commit() +{ + backEnd_->commit(); +} + +void session::rollback() +{ + backEnd_->rollback(); +} + +std::ostringstream & session::get_query_stream() +{ + if (isFromPool_) + { + return pool_->at(poolPosition_).get_query_stream(); + } + else + { + return query_stream_; + } +} + +void session::set_log_stream(std::ostream * s) +{ + if (isFromPool_) + { + pool_->at(poolPosition_).set_log_stream(s); + } + else + { + logStream_ = s; + } +} + +std::ostream * session::get_log_stream() const +{ + if (isFromPool_) + { + return pool_->at(poolPosition_).get_log_stream(); + } + else + { + return logStream_; + } +} + +void session::log_query(std::string const & query) +{ + if (isFromPool_) + { + pool_->at(poolPosition_).log_query(query); + } + else + { + if (logStream_ != NULL) + { + *logStream_ << query << '\n'; + } + + lastQuery_ = query; + } +} + +std::string session::get_last_query() const +{ + if (isFromPool_) + { + return pool_->at(poolPosition_).get_last_query(); + } + else + { + return lastQuery_; + } +} + +void session::set_got_data(bool gotData) +{ + if (isFromPool_) + { + pool_->at(poolPosition_).set_got_data(gotData); + } + else + { + gotData_ = gotData; + } +} + +bool session::got_data() const +{ + if (isFromPool_) + { + return pool_->at(poolPosition_).got_data(); + } + else + { + return gotData_; + } +} + +void session::uppercase_column_names(bool forceToUpper) +{ + if (isFromPool_) + { + pool_->at(poolPosition_).uppercase_column_names(forceToUpper); + } + else + { + uppercaseColumnNames_ = forceToUpper; + } +} + +bool session::get_uppercase_column_names() const +{ + if (isFromPool_) + { + return pool_->at(poolPosition_).get_uppercase_column_names(); + } + else + { + return uppercaseColumnNames_; + } +} + +std::string session::get_backend_name() const +{ + return backEnd_->get_backend_name(); +} + +statement_backend * session::make_statement_backend() +{ + ensureConnected(backEnd_); + + return backEnd_->make_statement_backend(); +} + +rowid_backend * session::make_rowid_backend() +{ + ensureConnected(backEnd_); + + return backEnd_->make_rowid_backend(); +} + +blob_backend * session::make_blob_backend() +{ + ensureConnected(backEnd_); + + return backEnd_->make_blob_backend(); +} diff --git a/src/core/session.h b/src/core/session.h new file mode 100644 index 00000000..29528df6 --- /dev/null +++ b/src/core/session.h @@ -0,0 +1,114 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_SESSION_H_INCLUDED +#define SOCI_SESSION_H_INCLUDED + +#include "once-temp-type.h" + +#include <ostream> +#include <sstream> +#include <string> + +namespace soci +{ +class values; +struct backend_factory; + +namespace details +{ + +class session_backend; +class statement_backend; +class rowid_backend; +class blob_backend; + +} // namespace details + +class connection_pool; + +class SOCI_DECL session +{ +public: + session(); + session(backend_factory const & factory, std::string const & connectString); + session(std::string const & backendName, std::string const & connectString); + explicit session(std::string const & connectString); + explicit session(connection_pool & pool); + + ~session(); + + void open(backend_factory const & factory, std::string const & connectString); + void open(std::string const & backendName, std::string const & connectString); + void open(std::string const & connectString); + void close(); + void reconnect(); + + void begin(); + void commit(); + void rollback(); + + // once and prepare are for syntax sugar only + details::once_type once; + details::prepare_type prepare; + + // even more sugar + template <typename T> + details::once_temp_type operator<<(T const & t) { return once << t; } + + std::ostringstream & get_query_stream(); + + // support for basic logging + void set_log_stream(std::ostream * s); + std::ostream * get_log_stream() const; + + void log_query(std::string const & query); + std::string get_last_query() const; + + void set_got_data(bool gotData); + bool got_data() const; + + void uppercase_column_names(bool forceToUpper); + + bool get_uppercase_column_names() const; + + // for diagnostics and advanced users + // (downcast it to expected back-end session class) + details::session_backend * get_backend() { return backEnd_; } + + std::string get_backend_name() const; + + details::statement_backend * make_statement_backend(); + details::rowid_backend * make_rowid_backend(); + details::blob_backend * make_blob_backend(); + +private: + session(session const &); + session& operator=(session const &); + + std::ostringstream query_stream_; + + std::ostream * logStream_; + std::string lastQuery_; + + backend_factory const * lastFactory_; + std::string lastConnectString_; + + bool uppercaseColumnNames_; + + details::session_backend * backEnd_; + + bool gotData_; + + bool isFromPool_; + std::size_t poolPosition_; + connection_pool * pool_; +}; + +} // namespace SOCI + +#endif // SOCI_SESSION_H_INCLUDED diff --git a/src/core/soci-backend.h b/src/core/soci-backend.h index 3251bd99..188d9574 100644 --- a/src/core/soci-backend.h +++ b/src/core/soci-backend.h @@ -1,196 +1,195 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef SOCI_COMMON_H_INCLUDED -#define SOCI_COMMON_H_INCLUDED +#ifndef SOCI_BACKEND_H_INCLUDED +#define SOCI_BACKEND_H_INCLUDED +#include "soci-config.h" + +#include "error.h" #include <cstddef> #include <map> -#include <stdexcept> #include <string> -#include "soci-config.h" - -namespace SOCI +namespace soci { // data types, as seen by the user -enum eDataType { eString, eChar, eDate, eDouble, eInteger, - eUnsignedLong }; - -// the enum type for indicator variables -enum eIndicator { eOK, eNoData, eNull, eTruncated }; - - -class SOCI_DECL SOCIError : public std::runtime_error +enum data_type { -public: - SOCIError(std::string const & msg); + dt_string, dt_date, dt_double, dt_integer, dt_unsigned_long, dt_long_long }; +// the enum type for indicator variables +enum indicator { i_ok, i_null, i_truncated }; namespace details { // data types, as used to describe exchange format -enum eExchangeType { eXChar, eXCString, eXStdString, eXShort, eXInteger, - eXUnsignedLong, eXDouble, eXStdTm, eXStatement, - eXRowID, eXBLOB }; +enum exchange_type +{ + x_char, x_cstring, x_stdstring, x_short, x_integer, + x_unsigned_long, x_long_long, x_double, x_stdtm, x_statement, + x_rowid, x_blob +}; // type of statement (used for optimizing statement preparation) -enum eStatementType { eOneTimeQuery, eRepeatableQuery }; +enum statement_type { st_one_time_query, st_repeatable_query }; // polymorphic into type backend -class StandardIntoTypeBackEnd +class standard_into_type_backend { public: - virtual ~StandardIntoTypeBackEnd() {} + virtual ~standard_into_type_backend() {} - virtual void defineByPos(int &position, - void *data, eExchangeType type) = 0; + virtual void define_by_pos(int & position, + void * data, exchange_type type) = 0; - virtual void preFetch() = 0; - virtual void postFetch(bool gotData, bool calledFromFetch, - eIndicator *ind) = 0; + virtual void pre_fetch() = 0; + virtual void post_fetch(bool gotData, bool calledFromFetch, + indicator * ind) = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; }; -class VectorIntoTypeBackEnd +class vector_into_type_backend { public: - virtual ~VectorIntoTypeBackEnd() {} + virtual ~vector_into_type_backend() {} - virtual void defineByPos(int &position, - void *data, eExchangeType type) = 0; + virtual void define_by_pos(int & position, + void * data, exchange_type type) = 0; - virtual void preFetch() = 0; - virtual void postFetch(bool gotData, eIndicator *ind) = 0; + virtual void pre_fetch() = 0; + virtual void post_fetch(bool gotData, indicator * ind) = 0; virtual void resize(std::size_t sz) = 0; virtual std::size_t size() = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; }; // polymorphic use type backend -class StandardUseTypeBackEnd +class standard_use_type_backend { public: - virtual ~StandardUseTypeBackEnd() {} + virtual ~standard_use_type_backend() {} - virtual void bindByPos(int &position, - void *data, eExchangeType type) = 0; - virtual void bindByName(std::string const &name, - void *data, eExchangeType type) = 0; + virtual void bind_by_pos(int & position, + void * data, exchange_type type, bool readOnly) = 0; + virtual void bind_by_name(std::string const & name, + void * data, exchange_type type, bool readOnly) = 0; - virtual void preUse(eIndicator const *ind) = 0; - virtual void postUse(bool gotData, eIndicator *ind) = 0; + virtual void pre_use(indicator const * ind) = 0; + virtual void post_use(bool gotData, indicator * ind) = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; }; -class VectorUseTypeBackEnd +class vector_use_type_backend { public: - virtual ~VectorUseTypeBackEnd() {} + virtual ~vector_use_type_backend() {} - virtual void bindByPos(int &position, - void *data, eExchangeType type) = 0; - virtual void bindByName(std::string const &name, - void *data, eExchangeType type) = 0; + virtual void bind_by_pos(int & position, + void * data, exchange_type type) = 0; + virtual void bind_by_name(std::string const & name, + void * data, exchange_type type) = 0; - virtual void preUse(eIndicator const *ind) = 0; + virtual void pre_use(indicator const * ind) = 0; virtual std::size_t size() = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; }; // polymorphic statement backend -class StatementBackEnd +class statement_backend { public: - virtual ~StatementBackEnd() {} + virtual ~statement_backend() {} virtual void alloc() = 0; - virtual void cleanUp() = 0; + virtual void clean_up() = 0; - virtual void prepare(std::string const &query, eStatementType eType) = 0; + virtual void prepare(std::string const & query, statement_type eType) = 0; - enum execFetchResult { eSuccess, eNoData }; - virtual execFetchResult execute(int number) = 0; - virtual execFetchResult fetch(int number) = 0; + enum exec_fetch_result { ef_success, ef_no_data }; + virtual exec_fetch_result execute(int number) = 0; + virtual exec_fetch_result fetch(int number) = 0; - virtual int getNumberOfRows() = 0; + virtual int get_number_of_rows() = 0; - virtual std::string rewriteForProcedureCall(std::string const &query) = 0; + virtual std::string rewrite_for_procedure_call(std::string const & query) = 0; - virtual int prepareForDescribe() = 0; - virtual void describeColumn(int colNum, eDataType &dtype, - std::string &columnName) = 0; + virtual int prepare_for_describe() = 0; + virtual void describe_column(int colNum, data_type & dtype, + std::string & column_name) = 0; - virtual StandardIntoTypeBackEnd * makeIntoTypeBackEnd() = 0; - virtual StandardUseTypeBackEnd * makeUseTypeBackEnd() = 0; - virtual VectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd() = 0; - virtual VectorUseTypeBackEnd * makeVectorUseTypeBackEnd() = 0; + virtual standard_into_type_backend * make_into_type_backend() = 0; + virtual standard_use_type_backend * make_use_type_backend() = 0; + virtual vector_into_type_backend * make_vector_into_type_backend() = 0; + virtual vector_use_type_backend * make_vector_use_type_backend() = 0; }; // polymorphic RowID backend -class RowIDBackEnd +class rowid_backend { public: - virtual ~RowIDBackEnd() {} + virtual ~rowid_backend() {} }; -// polymorphic RowID backend +// polymorphic blob backend -class BLOBBackEnd +class blob_backend { public: - virtual ~BLOBBackEnd() {} + virtual ~blob_backend() {} - virtual std::size_t getLen() = 0; - virtual std::size_t read(std::size_t offset, char *buf, + virtual std::size_t get_len() = 0; + virtual std::size_t read(std::size_t offset, char * buf, std::size_t toRead) = 0; - virtual std::size_t write(std::size_t offset, char const *buf, + virtual std::size_t write(std::size_t offset, char const * buf, std::size_t toWrite) = 0; - virtual std::size_t append(char const *buf, std::size_t toWrite) = 0; + virtual std::size_t append(char const * buf, std::size_t toWrite) = 0; virtual void trim(std::size_t newLen) = 0; }; // polymorphic session backend -class SessionBackEnd +class session_backend { public: - virtual ~SessionBackEnd() {} + virtual ~session_backend() {} virtual void begin() = 0; virtual void commit() = 0; virtual void rollback() = 0; - virtual StatementBackEnd * makeStatementBackEnd() = 0; - virtual RowIDBackEnd * makeRowIDBackEnd() = 0; - virtual BLOBBackEnd * makeBLOBBackEnd() = 0; + virtual std::string get_backend_name() const = 0; + + virtual statement_backend * make_statement_backend() = 0; + virtual rowid_backend * make_rowid_backend() = 0; + virtual blob_backend * make_blob_backend() = 0; }; // helper class used to keep pointer and buffer size as a single object -struct CStringDescriptor +struct cstring_descriptor { - CStringDescriptor(char *str, std::size_t bufSize) + cstring_descriptor(char * str, std::size_t bufSize) : str_(str), bufSize_(bufSize) {} - char *str_; + char * str_; std::size_t bufSize_; }; @@ -198,15 +197,14 @@ struct CStringDescriptor // simple base class for the session back-end factory -struct SOCI_DECL BackEndFactory +struct SOCI_DECL backend_factory { - virtual ~BackEndFactory() {} + virtual ~backend_factory() {} - virtual details::SessionBackEnd * makeSession( - std::string const &connectString) const = 0; + virtual details::session_backend * make_session( + std::string const & connectString) const = 0; }; -} // namespace SOCI - -#endif // SOCI_COMMON_H_INCLUDED +} // namespace soci +#endif // SOCI_BACKEND_H_INCLUDED diff --git a/src/core/soci-config.h b/src/core/soci-config.h index fd8f6d36..3cae58c9 100644 --- a/src/core/soci-config.h +++ b/src/core/soci-config.h @@ -1,5 +1,5 @@ // -// Copyright (C) 2006 Mateusz Loskot +// Copyright (C) 2006-2008 Mateusz Loskot // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -36,4 +36,3 @@ #endif // _MSC_VER #endif // SOCI_CONFIG_H_INCLUDED - diff --git a/src/core/soci-platform.h b/src/core/soci-platform.h index 2fc9548f..7a75aa4d 100644 --- a/src/core/soci-platform.h +++ b/src/core/soci-platform.h @@ -1,9 +1,10 @@ // -// Copyright (C) 2006 Mateusz Loskot +// Copyright (C) 2006-2008 Mateusz Loskot // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // + #ifndef SOCI_PLATFORM_H_INCLUDED #define SOCI_PLATFORM_H_INCLUDED @@ -30,4 +31,3 @@ #endif // _MSC_VER #endif // SOCI_PLATFORM_H_INCLUDED - diff --git a/src/core/soci-simple.cpp b/src/core/soci-simple.cpp new file mode 100644 index 00000000..ba16ceb6 --- /dev/null +++ b/src/core/soci-simple.cpp @@ -0,0 +1,1813 @@ +// +// Copyright (C) 2008 Maciej Sobczak +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE + +#include "soci-simple.h" +#include "soci.h" + +using namespace soci; + + +namespace // unnamed +{ + +struct session_wrapper +{ + session sql; + + bool is_ok; + std::string error_message; +}; + +} // namespace unnamed + + +SOCI_DECL session_handle soci_create_session(char const * connection_string) +{ + session_wrapper * wrapper; + try + { + wrapper = new session_wrapper(); + } + catch (...) + { + return NULL; + } + + try + { + wrapper->sql.open(connection_string); + wrapper->is_ok = true; + } + catch (std::exception const & e) + { + wrapper->is_ok = false; + wrapper->error_message = e.what(); + } + + return wrapper; +} + +SOCI_DECL void soci_destroy_session(session_handle s) +{ + session_wrapper * wrapper = static_cast<session_wrapper *>(s); + delete wrapper; +} + +SOCI_DECL void soci_begin(session_handle s) +{ + session_wrapper * wrapper = static_cast<session_wrapper *>(s); + try + { + wrapper->sql.begin(); + wrapper->is_ok = true; + } + catch (std::exception const & e) + { + wrapper->is_ok = false; + wrapper->error_message = e.what(); + } +} + +SOCI_DECL void soci_commit(session_handle s) +{ + session_wrapper * wrapper = static_cast<session_wrapper *>(s); + try + { + wrapper->sql.commit(); + wrapper->is_ok = true; + } + catch (std::exception const & e) + { + wrapper->is_ok = false; + wrapper->error_message = e.what(); + } +} + +SOCI_DECL void soci_rollback(session_handle s) +{ + session_wrapper * wrapper = static_cast<session_wrapper *>(s); + try + { + wrapper->sql.rollback(); + wrapper->is_ok = true; + } + catch (std::exception const & e) + { + wrapper->is_ok = false; + wrapper->error_message = e.what(); + } +} + +// this will not be needed until dynamic row is exposed +// SOCI_DECL void soci_uppercase_column_names(session_handle s, bool forceToUpper) +// { +// session_wrapper * wrapper = static_cast<session_wrapper *>(s); +// wrapper->sql.uppercase_column_names(forceToUpper); +// wrapper->is_ok = true; +// } + +SOCI_DECL int soci_session_state(session_handle s) +{ + session_wrapper * wrapper = static_cast<session_wrapper *>(s); + + return wrapper->is_ok ? 1 : 0; +} + +SOCI_DECL char const * soci_session_error_message(session_handle s) +{ + session_wrapper * wrapper = static_cast<session_wrapper *>(s); + + return wrapper->error_message.c_str(); +} + + +// statement + + +namespace // unnamed +{ + +struct statement_wrapper +{ + statement_wrapper(session & sql) + : st(sql), statement_state(clean), into_kind(empty), use_kind(empty), + next_position(0), is_ok(true) {} + + statement st; + + enum state { clean, defining, executing } statement_state; + enum kind { empty, single, bulk } into_kind, use_kind; + + // into elements + int next_position; + std::vector<data_type> into_types; // for both single and bulk + std::vector<indicator> into_indicators; + std::map<int, std::string> into_strings; + std::map<int, int> into_ints; + std::map<int, long long> into_longlongs; + std::map<int, double> into_doubles; + std::map<int, std::tm> into_dates; + + std::vector<std::vector<indicator> > into_indicators_v; + std::map<int, std::vector<std::string> > into_strings_v; + std::map<int, std::vector<int> > into_ints_v; + std::map<int, std::vector<long long> > into_longlongs_v; + std::map<int, std::vector<double> > into_doubles_v; + std::map<int, std::vector<std::tm> > into_dates_v; + + // use elements + std::map<std::string, indicator> use_indicators; + std::map<std::string, std::string> use_strings; + std::map<std::string, int> use_ints; + std::map<std::string, long long> use_longlongs; + std::map<std::string, double> use_doubles; + std::map<std::string, std::tm> use_dates; + + std::map<std::string, std::vector<indicator> > use_indicators_v; + std::map<std::string, std::vector<std::string> > use_strings_v; + std::map<std::string, std::vector<int> > use_ints_v; + std::map<std::string, std::vector<long long> > use_longlongs_v; + std::map<std::string, std::vector<double> > use_doubles_v; + std::map<std::string, std::vector<std::tm> > use_dates_v; + + // format is: "YYYY MM DD hh mm ss" + char date_formatted[20]; + + bool is_ok; + std::string error_message; +}; + +// helper for checking if the attempt was made to add more into/use elements +// after the statement was set for execution +bool cannot_add_elements(statement_wrapper & wrapper, statement_wrapper::kind k, bool into) +{ + if (wrapper.statement_state == statement_wrapper::executing) + { + wrapper.is_ok = false; + wrapper.error_message = "Cannot add more data items."; + return true; + } + + if (into) + { + if (k == statement_wrapper::single && wrapper.into_kind == statement_wrapper::bulk) + { + wrapper.is_ok = false; + wrapper.error_message = "Cannot add single into data items."; + return true; + } + if (k == statement_wrapper::bulk && wrapper.into_kind == statement_wrapper::single) + { + wrapper.is_ok = false; + wrapper.error_message = "Cannot add vector into data items."; + return true; + } + } + else + { + // trying to add use elements + if (k == statement_wrapper::single && wrapper.use_kind == statement_wrapper::bulk) + { + wrapper.is_ok = false; + wrapper.error_message = "Cannot add single use data items."; + return true; + } + if (k == statement_wrapper::bulk && wrapper.use_kind == statement_wrapper::single) + { + wrapper.is_ok = false; + wrapper.error_message = "Cannot add vector use data items."; + return true; + } + } + + wrapper.is_ok = true; + return false; +} + +// helper for checking if the expected into element exists on the given position +bool position_check_failed(statement_wrapper & wrapper, statement_wrapper::kind k, + int position, data_type expected_type, char const * type_name) +{ + if (position < 0 || position >= wrapper.next_position) + { + wrapper.is_ok = false; + wrapper.error_message = "Invalid position."; + return true; + } + + if (wrapper.into_types[position] != expected_type) + { + wrapper.is_ok = false; + wrapper.error_message = "No into "; + if (k == statement_wrapper::bulk) + { + wrapper.error_message += "vector "; + } + wrapper.error_message += type_name; + wrapper.error_message += " element at this position."; + return true; + } + + wrapper.is_ok = true; + return false; +} + +// helper for checking if the into element on the given position +// is not null +bool not_null_check_failed(statement_wrapper & wrapper, int position) +{ + if (wrapper.into_indicators[position] == i_null) + { + wrapper.is_ok = false; + wrapper.error_message = "Element is null."; + return true; + } + + wrapper.is_ok = true; + return false; +} + +// overloaded version for vectors +bool not_null_check_failed(statement_wrapper & wrapper, int position, int index) +{ + if (wrapper.into_indicators_v[position][index] == i_null) + { + wrapper.is_ok = false; + wrapper.error_message = "Element is null."; + return true; + } + + wrapper.is_ok = true; + return false; +} + +// helper for checking the index value +template <typename T> +bool index_check_failed(std::vector<T> const & v, + statement_wrapper & wrapper, int index) +{ + if (index < 0 || index >= static_cast<int>(v.size())) + { + wrapper.is_ok = false; + wrapper.error_message = "Invalid index."; + return true; + } + + wrapper.is_ok = true; + return false; +} + +// helper for checking the uniqueness of the use element's name +bool name_unique_check_failed(statement_wrapper & wrapper, + statement_wrapper::kind k, char const * name) +{ + bool is_unique; + if (k == statement_wrapper::single) + { + typedef std::map<std::string, indicator>::const_iterator iterator; + iterator const it = wrapper.use_indicators.find(name); + is_unique = it == wrapper.use_indicators.end(); + } + else + { + // vector version + + typedef std::map<std::string, std::vector<indicator> >::const_iterator + iterator; + iterator const it = wrapper.use_indicators_v.find(name); + is_unique = it == wrapper.use_indicators_v.end(); + } + + if (is_unique) + { + wrapper.is_ok = true; + return false; + } + else + { + wrapper.is_ok = false; + wrapper.error_message = "Name of use element should be unique."; + return true; + } +} + +// helper for checking if the use element with the given name exists +bool name_exists_check_failed(statement_wrapper & wrapper, + char const * name, data_type expected_type, + statement_wrapper::kind k, char const * type_name) +{ + bool name_exists = false; + if (k == statement_wrapper::single) + { + switch (expected_type) + { + case dt_string: + { + typedef std::map<std::string, std::string>::const_iterator + iterator; + iterator const it = wrapper.use_strings.find(name); + name_exists = (it != wrapper.use_strings.end()); + } + break; + case dt_integer: + { + typedef std::map<std::string, int>::const_iterator iterator; + iterator const it = wrapper.use_ints.find(name); + name_exists = (it != wrapper.use_ints.end()); + } + break; + case dt_long_long: + { + typedef std::map<std::string, long long>::const_iterator + iterator; + iterator const it = wrapper.use_longlongs.find(name); + name_exists = (it != wrapper.use_longlongs.end()); + } + break; + case dt_double: + { + typedef std::map<std::string, double>::const_iterator iterator; + iterator const it = wrapper.use_doubles.find(name); + name_exists = (it != wrapper.use_doubles.end()); + } + break; + case dt_date: + { + typedef std::map<std::string, std::tm>::const_iterator iterator; + iterator const it = wrapper.use_dates.find(name); + name_exists = (it != wrapper.use_dates.end()); + } + break; + default: + assert(false); + } + } + else + { + // vector version + + switch (expected_type) + { + case dt_string: + { + typedef std::map<std::string, + std::vector<std::string> >::const_iterator iterator; + iterator const it = wrapper.use_strings_v.find(name); + name_exists = (it != wrapper.use_strings_v.end()); + } + break; + case dt_integer: + { + typedef std::map<std::string, + std::vector<int> >::const_iterator iterator; + iterator const it = wrapper.use_ints_v.find(name); + name_exists = (it != wrapper.use_ints_v.end()); + } + break; + case dt_long_long: + { + typedef std::map<std::string, + std::vector<long long> >::const_iterator iterator; + iterator const it = wrapper.use_longlongs_v.find(name); + name_exists = (it != wrapper.use_longlongs_v.end()); + } + break; + case dt_double: + { + typedef std::map<std::string, + std::vector<double> >::const_iterator iterator; + iterator const it = wrapper.use_doubles_v.find(name); + name_exists = (it != wrapper.use_doubles_v.end()); + } + break; + case dt_date: + { + typedef std::map<std::string, + std::vector<std::tm> >::const_iterator iterator; + iterator const it = wrapper.use_dates_v.find(name); + name_exists = (it != wrapper.use_dates_v.end()); + } + break; + default: + assert(false); + } + } + + if (name_exists) + { + wrapper.is_ok = true; + return false; + } + else + { + wrapper.is_ok = false; + wrapper.error_message = "No use "; + wrapper.error_message += type_name; + wrapper.error_message += " element with this name."; + return true; + } +} + +// helper function for resizing all vectors<T> in the map +template <typename T> +void resize_in_map(std::map<std::string, std::vector<T> > & m, int new_size) +{ + typedef typename std::map<std::string, std::vector<T> >::iterator iterator; + iterator it = m.begin(); + iterator const end = m.end(); + for ( ; it != end; ++it) + { + std::vector<T> & v = it->second; + v.resize(new_size); + } +} + +// helper for formatting date values +char const * format_date(statement_wrapper & wrapper, std::tm const & d) +{ + sprintf(wrapper.date_formatted, "%d %d %d %d %d %d", + d.tm_year + 1900, d.tm_mon + 1, d.tm_mday, + d.tm_hour, d.tm_min, d.tm_sec); + + return wrapper.date_formatted; +} + +bool string_to_date(char const * val, std::tm & /* out */ dt, + statement_wrapper & wrapper) +{ + // format is: "YYYY MM DD hh mm ss" + int year; + int month; + int day; + int hour; + int minute; + int second; + int const converted = sscanf(val, "%d %d %d %d %d %d", + &year, &month, &day, &hour, &minute, &second); + if (converted != 6) + { + wrapper.is_ok = false; + wrapper.error_message = "Cannot convert date."; + return false; + } + + wrapper.is_ok = true; + + dt.tm_year = year - 1900; + dt.tm_mon = month - 1; + dt.tm_mday = day; + dt.tm_hour = hour; + dt.tm_min = minute; + dt.tm_sec = second; + +return true; +} + +} // namespace unnamed + + +SOCI_DECL statement_handle soci_create_statement(session_handle s) +{ + session_wrapper * session_w = static_cast<session_wrapper *>(s); + try + { + statement_wrapper * statement_w = new statement_wrapper(session_w->sql); + return statement_w; + } + catch (std::exception const & e) + { + session_w->is_ok = false; + session_w->error_message = e.what(); + return NULL; + } +} + +SOCI_DECL void soci_destroy_statement(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + delete wrapper; +} + +SOCI_DECL int soci_into_string(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::single; + + wrapper->into_types.push_back(dt_string); + wrapper->into_indicators.push_back(i_ok); + wrapper->into_strings[wrapper->next_position]; // create new entry + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_int(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::single; + + wrapper->into_types.push_back(dt_integer); + wrapper->into_indicators.push_back(i_ok); + wrapper->into_ints[wrapper->next_position]; // create new entry + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_long_long(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::single; + + wrapper->into_types.push_back(dt_long_long); + wrapper->into_indicators.push_back(i_ok); + wrapper->into_longlongs[wrapper->next_position]; // create new entry + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_double(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::single; + + wrapper->into_types.push_back(dt_double); + wrapper->into_indicators.push_back(i_ok); + wrapper->into_doubles[wrapper->next_position]; // create new entry + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_date(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::single; + + wrapper->into_types.push_back(dt_date); + wrapper->into_indicators.push_back(i_ok); + wrapper->into_dates[wrapper->next_position]; // create new entry + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_string_v(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::bulk; + + wrapper->into_types.push_back(dt_string); + wrapper->into_indicators_v.push_back(std::vector<indicator>()); + wrapper->into_strings_v[wrapper->next_position]; + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_int_v(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::bulk; + + wrapper->into_types.push_back(dt_integer); + wrapper->into_indicators_v.push_back(std::vector<indicator>()); + wrapper->into_ints_v[wrapper->next_position]; + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_long_long_v(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::bulk; + + wrapper->into_types.push_back(dt_long_long); + wrapper->into_indicators_v.push_back(std::vector<indicator>()); + wrapper->into_longlongs_v[wrapper->next_position]; + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_double_v(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::bulk; + + wrapper->into_types.push_back(dt_double); + wrapper->into_indicators_v.push_back(std::vector<indicator>()); + wrapper->into_doubles_v[wrapper->next_position]; + return wrapper->next_position++; +} + +SOCI_DECL int soci_into_date_v(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, true)) + { + return -1; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->into_kind = statement_wrapper::bulk; + + wrapper->into_types.push_back(dt_date); + wrapper->into_indicators_v.push_back(std::vector<indicator>()); + wrapper->into_dates_v[wrapper->next_position]; + return wrapper->next_position++; +} + +SOCI_DECL int soci_get_into_state(statement_handle st, int position) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position < 0 || position >= wrapper->next_position) + { + wrapper->is_ok = false; + wrapper->error_message = "Invalid position."; + return 0; + } + + wrapper->is_ok = true; + return wrapper->into_indicators[position] == i_ok ? 1 : 0; +} + +SOCI_DECL char const * soci_get_into_string(statement_handle st, int position) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::single, position, dt_string, "string") || + not_null_check_failed(*wrapper, position)) + { + return ""; + } + + return wrapper->into_strings[position].c_str(); +} + +SOCI_DECL int soci_get_into_int(statement_handle st, int position) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::single, position, dt_integer, "int") || + not_null_check_failed(*wrapper, position)) + { + return 0; + } + + return wrapper->into_ints[position]; +} + +SOCI_DECL long long soci_get_into_long_long(statement_handle st, int position) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::single, position, dt_long_long, "long long") || + not_null_check_failed(*wrapper, position)) + { + return 0LL; + } + + return wrapper->into_longlongs[position]; +} + +SOCI_DECL double soci_get_into_double(statement_handle st, int position) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::single, position, dt_double, "double") || + not_null_check_failed(*wrapper, position)) + { + return 0.0; + } + + return wrapper->into_doubles[position]; +} + +SOCI_DECL char const * soci_get_into_date(statement_handle st, int position) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::single, position, dt_date, "date") || + not_null_check_failed(*wrapper, position)) + { + return ""; + } + + // format is: "YYYY MM DD hh mm ss" + std::tm const & d = wrapper->into_dates[position]; + return format_date(*wrapper, d); +} + +SOCI_DECL int soci_into_get_size_v(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (wrapper->into_kind != statement_wrapper::bulk) + { + wrapper->is_ok = false; + wrapper->error_message = "No vector into elements."; + return -1; + } + + return static_cast<int>(wrapper->into_indicators_v[0].size()); +} + +SOCI_DECL void soci_into_resize_v(statement_handle st, int new_size) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (new_size <= 0) + { + wrapper->is_ok = false; + wrapper->error_message = "Invalid size."; + return; + } + + if (wrapper->into_kind != statement_wrapper::bulk) + { + wrapper->is_ok = false; + wrapper->error_message = "No vector into elements."; + return; + } + + for (int i = 0; i != wrapper->next_position; ++i) + { + wrapper->into_indicators_v[i].resize(new_size); + + switch (wrapper->into_types[i]) + { + case dt_string: + wrapper->into_strings_v[i].resize(new_size); + break; + case dt_integer: + wrapper->into_ints_v[i].resize(new_size); + break; + case dt_long_long: + wrapper->into_longlongs_v[i].resize(new_size); + break; + case dt_double: + wrapper->into_doubles_v[i].resize(new_size); + break; + case dt_date: + wrapper->into_dates_v[i].resize(new_size); + break; + default: + assert(false); + } + } + + wrapper->is_ok = true; +} + +SOCI_DECL int soci_get_into_state_v(statement_handle st, int position, int index) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position < 0 || position >= wrapper->next_position) + { + wrapper->is_ok = false; + wrapper->error_message = "Invalid position."; + return 0; + } + + std::vector<indicator> const & v = wrapper->into_indicators_v[position]; + if (index_check_failed(v, *wrapper, index)) + { + return 0; + } + + return v[index] == i_ok ? 1 : 0; +} + +SOCI_DECL char const * soci_get_into_string_v(statement_handle st, int position, int index) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::bulk, position, dt_string, "string")) + { + return ""; + } + + std::vector<std::string> const & v = wrapper->into_strings_v[position]; + if (index_check_failed(v, *wrapper, index) || + not_null_check_failed(*wrapper, position, index)) + { + return ""; + } + + return v[index].c_str(); +} + +SOCI_DECL int soci_get_into_int_v(statement_handle st, int position, int index) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::bulk, position, dt_integer, "int")) + { + return 0; + } + + std::vector<int> const & v = wrapper->into_ints_v[position]; + if (index_check_failed(v, *wrapper, index) || + not_null_check_failed(*wrapper, position, index)) + { + return 0; + } + + return v[index]; +} + +SOCI_DECL long long soci_get_into_long_long_v(statement_handle st, int position, int index) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::bulk, position, dt_long_long, "long long")) + { + return 0; + } + + std::vector<long long> const & v = wrapper->into_longlongs_v[position]; + if (index_check_failed(v, *wrapper, index) || + not_null_check_failed(*wrapper, position, index)) + { + return 0; + } + + return v[index]; +} + +SOCI_DECL double soci_get_into_double_v(statement_handle st, int position, int index) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::bulk, position, dt_double, "double")) + { + return 0.0; + } + + std::vector<double> const & v = wrapper->into_doubles_v[position]; + if (index_check_failed(v, *wrapper, index) || + not_null_check_failed(*wrapper, position, index)) + { + return 0.0; + } + + return v[index]; +} + +SOCI_DECL char const * soci_get_into_date_v(statement_handle st, int position, int index) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (position_check_failed(*wrapper, + statement_wrapper::bulk, position, dt_date, "date")) + { + return ""; + } + + std::vector<std::tm> const & v = wrapper->into_dates_v[position]; + if (index_check_failed(v, *wrapper, index) || + not_null_check_failed(*wrapper, position, index)) + { + return ""; + } + + return format_date(*wrapper, v[index]); +} + +SOCI_DECL void soci_use_string(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, false) || + name_unique_check_failed(*wrapper, statement_wrapper::single, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::single; + + wrapper->use_indicators[name] = i_ok; // create new entry + wrapper->use_strings[name]; // create new entry +} + +SOCI_DECL void soci_use_int(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, false) || + name_unique_check_failed(*wrapper, statement_wrapper::single, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::single; + + wrapper->use_indicators[name] = i_ok; // create new entry + wrapper->use_ints[name]; // create new entry +} + +SOCI_DECL void soci_use_long_long(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, false) || + name_unique_check_failed(*wrapper, statement_wrapper::single, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::single; + + wrapper->use_indicators[name] = i_ok; // create new entry + wrapper->use_longlongs[name]; // create new entry +} + +SOCI_DECL void soci_use_double(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, false) || + name_unique_check_failed(*wrapper, statement_wrapper::single, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::single; + + wrapper->use_indicators[name] = i_ok; // create new entry + wrapper->use_doubles[name]; // create new entry +} + +SOCI_DECL void soci_use_date(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::single, false) || + name_unique_check_failed(*wrapper, statement_wrapper::single, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::single; + + wrapper->use_indicators[name] = i_ok; // create new entry + wrapper->use_dates[name]; // create new entry +} + +SOCI_DECL void soci_use_string_v(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, false) || + name_unique_check_failed(*wrapper, statement_wrapper::bulk, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::bulk; + + wrapper->use_indicators_v[name]; // create new entry + wrapper->use_strings_v[name]; // create new entry +} + +SOCI_DECL void soci_use_int_v(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, false) || + name_unique_check_failed(*wrapper, statement_wrapper::bulk, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::bulk; + + wrapper->use_indicators_v[name]; // create new entry + wrapper->use_ints_v[name]; // create new entry +} + +SOCI_DECL void soci_use_long_long_v(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, false) || + name_unique_check_failed(*wrapper, statement_wrapper::bulk, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::bulk; + + wrapper->use_indicators_v[name]; // create new entry + wrapper->use_longlongs_v[name]; // create new entry +} + +SOCI_DECL void soci_use_double_v(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, false) || + name_unique_check_failed(*wrapper, statement_wrapper::bulk, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::bulk; + + wrapper->use_indicators_v[name]; // create new entry + wrapper->use_doubles_v[name]; // create new entry +} + +SOCI_DECL void soci_use_date_v(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (cannot_add_elements(*wrapper, statement_wrapper::bulk, false) || + name_unique_check_failed(*wrapper, statement_wrapper::bulk, name)) + { + return; + } + + wrapper->statement_state = statement_wrapper::defining; + wrapper->use_kind = statement_wrapper::bulk; + + wrapper->use_indicators_v[name]; // create new entry + wrapper->use_dates_v[name]; // create new entry +} + +SOCI_DECL void soci_set_use_state(statement_handle st, char const * name, int state) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + typedef std::map<std::string, indicator>::const_iterator iterator; + iterator const it = wrapper->use_indicators.find(name); + if (it == wrapper->use_indicators.end()) + { + wrapper->is_ok = false; + wrapper->error_message = "Invalid name."; + return; + } + + wrapper->is_ok = true; + wrapper->use_indicators[name] = (state != 0 ? i_ok : i_null); +} + +SOCI_DECL void soci_set_use_string(statement_handle st, char const * name, char const * val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_string, statement_wrapper::single, "string")) + { + return; + } + + wrapper->use_indicators[name] = i_ok; + wrapper->use_strings[name] = val; +} + +SOCI_DECL void soci_set_use_int(statement_handle st, char const * name, int val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_integer, statement_wrapper::single, "int")) + { + return; + } + + wrapper->use_indicators[name] = i_ok; + wrapper->use_ints[name] = val; +} + +SOCI_DECL void soci_set_use_long_long(statement_handle st, char const * name, long long val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_long_long, statement_wrapper::single, "long long")) + { + return; + } + + wrapper->use_indicators[name] = i_ok; + wrapper->use_longlongs[name] = val; +} + +SOCI_DECL void soci_set_use_double(statement_handle st, char const * name, double val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_double, statement_wrapper::single, "double")) + { + return; + } + + wrapper->use_indicators[name] = i_ok; + wrapper->use_doubles[name] = val; +} + +SOCI_DECL void soci_set_use_date(statement_handle st, char const * name, char const * val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_date, statement_wrapper::single, "date")) + { + return; + } + + std::tm dt; + bool const converted = string_to_date(val, dt, *wrapper); + if (converted == false) + { + return; + } + + wrapper->use_indicators[name] = i_ok; + wrapper->use_dates[name] = dt; +} + +SOCI_DECL int soci_use_get_size_v(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (wrapper->use_kind != statement_wrapper::bulk) + { + wrapper->is_ok = false; + wrapper->error_message = "No vector use elements."; + return -1; + } + + typedef std::map<std::string, + std::vector<indicator> >::const_iterator iterator; + iterator const any_element = wrapper->use_indicators_v.begin(); + assert(any_element != wrapper->use_indicators_v.end()); + + return static_cast<int>(any_element->second.size()); +} + +SOCI_DECL void soci_use_resize_v(statement_handle st, int new_size) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (new_size <= 0) + { + wrapper->is_ok = false; + wrapper->error_message = "Invalid size."; + return; + } + + if (wrapper->use_kind != statement_wrapper::bulk) + { + wrapper->is_ok = false; + wrapper->error_message = "No vector use elements."; + return; + } + + resize_in_map(wrapper->use_indicators_v, new_size); + resize_in_map(wrapper->use_strings_v, new_size); + resize_in_map(wrapper->use_ints_v, new_size); + resize_in_map(wrapper->use_longlongs_v, new_size); + resize_in_map(wrapper->use_doubles_v, new_size); + resize_in_map(wrapper->use_dates_v, new_size); + + wrapper->is_ok = true; +} + +SOCI_DECL void soci_set_use_state_v(statement_handle st, + char const * name, int index, int state) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + typedef std::map<std::string, std::vector<indicator> >::iterator iterator; + iterator const it = wrapper->use_indicators_v.find(name); + if (it == wrapper->use_indicators_v.end()) + { + wrapper->is_ok = false; + wrapper->error_message = "Invalid name."; + return; + } + + std::vector<indicator> & v = it->second; + if (index_check_failed(v, *wrapper, index)) + { + return; + } + + v[index] = (state != 0 ? i_ok : i_null); +} + +SOCI_DECL void soci_set_use_string_v(statement_handle st, + char const * name, int index, char const * val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_string, statement_wrapper::bulk, "vector string")) + { + return; + } + + std::vector<std::string> & v = wrapper->use_strings_v[name]; + if (index_check_failed(v, *wrapper, index)) + { + return; + } + + wrapper->use_indicators_v[name][index] = i_ok; + v[index] = val; +} + +SOCI_DECL void soci_set_use_int_v(statement_handle st, + char const * name, int index, int val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_integer, statement_wrapper::bulk, "vector int")) + { + return; + } + + std::vector<int> & v = wrapper->use_ints_v[name]; + if (index_check_failed(v, *wrapper, index)) + { + return; + } + + wrapper->use_indicators_v[name][index] = i_ok; + v[index] = val; +} + +SOCI_DECL void soci_set_use_long_long_v(statement_handle st, + char const * name, int index, long long val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_long_long, statement_wrapper::bulk, "vector long long")) + { + return; + } + + std::vector<long long> & v = wrapper->use_longlongs_v[name]; + if (index_check_failed(v, *wrapper, index)) + { + return; + } + + wrapper->use_indicators_v[name][index] = i_ok; + v[index] = val; +} + +SOCI_DECL void soci_set_use_double_v(statement_handle st, + char const * name, int index, double val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_double, statement_wrapper::bulk, "vector double")) + { + return; + } + + std::vector<double> & v = wrapper->use_doubles_v[name]; + if (index_check_failed(v, *wrapper, index)) + { + return; + } + + wrapper->use_indicators_v[name][index] = i_ok; + v[index] = val; +} + +SOCI_DECL void soci_set_use_date_v(statement_handle st, + char const * name, int index, char const * val) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_date, statement_wrapper::bulk, "vector date")) + { + return; + } + + std::vector<std::tm> & v = wrapper->use_dates_v[name]; + if (index_check_failed(v, *wrapper, index)) + { + return; + } + + std::tm dt; + bool const converted = string_to_date(val, dt, *wrapper); + if (converted == false) + { + return; + } + + wrapper->use_indicators_v[name][index] = i_ok; + v[index] = dt; +} + +SOCI_DECL int soci_get_use_state(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + typedef std::map<std::string, indicator>::const_iterator iterator; + iterator const it = wrapper->use_indicators.find(name); + if (it == wrapper->use_indicators.end()) + { + wrapper->is_ok = false; + wrapper->error_message = "Invalid name."; + return 0; + } + + wrapper->is_ok = true; + return wrapper->use_indicators[name] == i_ok ? 1 : 0; +} + +SOCI_DECL char const * soci_get_use_string(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_string, statement_wrapper::bulk, "string")) + { + return ""; + } + + return wrapper->use_strings[name].c_str(); +} + +SOCI_DECL int soci_get_use_int(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_integer, statement_wrapper::bulk, "int")) + { + return 0; + } + + return wrapper->use_ints[name]; +} + +SOCI_DECL long long soci_get_use_long_long(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_long_long, statement_wrapper::bulk, "long long")) + { + return 0LL; + } + + return wrapper->use_longlongs[name]; +} + +SOCI_DECL double soci_get_use_double(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_double, statement_wrapper::bulk, "double")) + { + return 0.0; + } + + return wrapper->use_doubles[name]; +} + +SOCI_DECL char const * soci_get_use_date(statement_handle st, char const * name) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + if (name_exists_check_failed(*wrapper, + name, dt_date, statement_wrapper::bulk, "date")) + { + return ""; + } + + // format is: "YYYY MM DD hh mm ss" + std::tm const & d = wrapper->use_dates[name]; + sprintf(wrapper->date_formatted, "%d %d %d %d %d %d", + d.tm_year + 1900, d.tm_mon + 1, d.tm_mday, + d.tm_hour, d.tm_min, d.tm_sec); + + return wrapper->date_formatted; +} + +SOCI_DECL void soci_prepare(statement_handle st, char const * query) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + try + { + wrapper->statement_state = statement_wrapper::executing; + + // bind all into elements + + size_t const into_elements = wrapper->into_types.size(); + if (wrapper->into_kind == statement_wrapper::single) + { + for (size_t i = 0; i != into_elements; ++i) + { + switch (wrapper->into_types[i]) + { + case dt_string: + wrapper->st.exchange( + into(wrapper->into_strings[i], wrapper->into_indicators[i])); + break; + case dt_integer: + wrapper->st.exchange( + into(wrapper->into_ints[i], wrapper->into_indicators[i])); + break; + case dt_long_long: + wrapper->st.exchange( + into(wrapper->into_longlongs[i], wrapper->into_indicators[i])); + break; + case dt_double: + wrapper->st.exchange( + into(wrapper->into_doubles[i], wrapper->into_indicators[i])); + break; + case dt_date: + wrapper->st.exchange( + into(wrapper->into_dates[i], wrapper->into_indicators[i])); + break; + default: + assert(false); + } + } + } + else + { + // vector elements + + for (size_t i = 0; i != into_elements; ++i) + { + switch (wrapper->into_types[i]) + { + case dt_string: + wrapper->st.exchange( + into(wrapper->into_strings_v[i], wrapper->into_indicators_v[i])); + break; + case dt_integer: + wrapper->st.exchange( + into(wrapper->into_ints_v[i], wrapper->into_indicators_v[i])); + break; + case dt_long_long: + wrapper->st.exchange( + into(wrapper->into_longlongs_v[i], wrapper->into_indicators_v[i])); + break; + case dt_double: + wrapper->st.exchange( + into(wrapper->into_doubles_v[i], wrapper->into_indicators_v[i])); + break; + case dt_date: + wrapper->st.exchange( + into(wrapper->into_dates_v[i], wrapper->into_indicators_v[i])); + break; + default: + assert(false); + } + } + } + + // bind all use elements + { + // strings + typedef std::map<std::string, std::string>::iterator iterator; + iterator uit = wrapper->use_strings.begin(); + iterator const uend = wrapper->use_strings.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + std::string & use_string = uit->second; + indicator & use_ind = wrapper->use_indicators[use_name]; + wrapper->st.exchange(use(use_string, use_ind, use_name)); + } + } + { + // ints + typedef std::map<std::string, int>::iterator iterator; + iterator uit = wrapper->use_ints.begin(); + iterator const uend = wrapper->use_ints.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + int & use_int = uit->second; + indicator & use_ind = wrapper->use_indicators[use_name]; + wrapper->st.exchange(use(use_int, use_ind, use_name)); + } + } + { + // longlongs + typedef std::map<std::string, long long>::iterator iterator; + iterator uit = wrapper->use_longlongs.begin(); + iterator const uend = wrapper->use_longlongs.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + long long & use_longlong = uit->second; + indicator & use_ind = wrapper->use_indicators[use_name]; + wrapper->st.exchange(use(use_longlong, use_ind, use_name)); + } + } + { + // doubles + typedef std::map<std::string, double>::iterator iterator; + iterator uit = wrapper->use_doubles.begin(); + iterator const uend = wrapper->use_doubles.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + double & use_double = uit->second; + indicator & use_ind = wrapper->use_indicators[use_name]; + wrapper->st.exchange(use(use_double, use_ind, use_name)); + } + } + { + // dates + typedef std::map<std::string, std::tm>::iterator iterator; + iterator uit = wrapper->use_dates.begin(); + iterator const uend = wrapper->use_dates.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + std::tm & use_date = uit->second; + indicator & use_ind = wrapper->use_indicators[use_name]; + wrapper->st.exchange(use(use_date, use_ind, use_name)); + } + } + + // bind all use vecctor elements + { + // strings + typedef std::map<std::string, + std::vector<std::string> >::iterator iterator; + iterator uit = wrapper->use_strings_v.begin(); + iterator const uend = wrapper->use_strings_v.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + std::vector<std::string> & use_string = uit->second; + std::vector<indicator> & use_ind = + wrapper->use_indicators_v[use_name]; + wrapper->st.exchange(use(use_string, use_ind, use_name)); + } + } + { + // ints + typedef std::map<std::string, + std::vector<int> >::iterator iterator; + iterator uit = wrapper->use_ints_v.begin(); + iterator const uend = wrapper->use_ints_v.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + std::vector<int> & use_int = uit->second; + std::vector<indicator> & use_ind = + wrapper->use_indicators_v[use_name]; + wrapper->st.exchange(use(use_int, use_ind, use_name)); + } + } + { + // longlongs + typedef std::map<std::string, + std::vector<long long> >::iterator iterator; + iterator uit = wrapper->use_longlongs_v.begin(); + iterator const uend = wrapper->use_longlongs_v.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + std::vector<long long> & use_longlong = uit->second; + std::vector<indicator> & use_ind = + wrapper->use_indicators_v[use_name]; + wrapper->st.exchange(use(use_longlong, use_ind, use_name)); + } + } + { + // doubles + typedef std::map<std::string, + std::vector<double> >::iterator iterator; + iterator uit = wrapper->use_doubles_v.begin(); + iterator const uend = wrapper->use_doubles_v.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + std::vector<double> & use_double = uit->second; + std::vector<indicator> & use_ind = + wrapper->use_indicators_v[use_name]; + wrapper->st.exchange(use(use_double, use_ind, use_name)); + } + } + { + // dates + typedef std::map<std::string, + std::vector<std::tm> >::iterator iterator; + iterator uit = wrapper->use_dates_v.begin(); + iterator const uend = wrapper->use_dates_v.end(); + for ( ; uit != uend; ++uit) + { + std::string const & use_name = uit->first; + std::vector<std::tm> & use_date = uit->second; + std::vector<indicator> & use_ind = + wrapper->use_indicators_v[use_name]; + wrapper->st.exchange(use(use_date, use_ind, use_name)); + } + } + + wrapper->st.alloc(); + wrapper->st.prepare(query); + wrapper->st.define_and_bind(); + + wrapper->is_ok = true; + } + catch (std::exception const & e) + { + wrapper->is_ok = false; + wrapper->error_message = e.what(); + } +} + +SOCI_DECL int soci_execute(statement_handle st, int withDataExchange) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + try + { + bool const gotData = wrapper->st.execute(withDataExchange != 0); + + wrapper->is_ok = true; + + return gotData ? 1 : 0; + } + catch (std::exception const & e) + { + wrapper->is_ok = false; + wrapper->error_message = e.what(); + + return 0; + } +} + +SOCI_DECL int soci_fetch(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + try + { + bool const gotData = wrapper->st.fetch(); + + wrapper->is_ok = true; + + return gotData ? 1 : 0; + } + catch (std::exception const & e) + { + wrapper->is_ok = false; + wrapper->error_message = e.what(); + + return 0; + } +} + +SOCI_DECL int soci_got_data(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + return wrapper->st.got_data() ? 1 : 0; +} + +SOCI_DECL int soci_statement_state(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + return wrapper->is_ok ? 1 : 0; +} + +SOCI_DECL char const * soci_statement_error_message(statement_handle st) +{ + statement_wrapper * wrapper = static_cast<statement_wrapper *>(st); + + return wrapper->error_message.c_str(); +} diff --git a/src/core/soci-simple.h b/src/core/soci-simple.h new file mode 100644 index 00000000..9fd36677 --- /dev/null +++ b/src/core/soci-simple.h @@ -0,0 +1,136 @@ +// +// Copyright (C) 2008 Maciej Sobczak +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_SIMPLE_H_INCLUDED +#define SOCI_SIMPLE_H_INCLUDED + +#include "soci-config.h" + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +// session + +typedef void * session_handle; +SOCI_DECL session_handle soci_create_session(char const * connectionString); +SOCI_DECL void soci_destroy_session(session_handle s); + +SOCI_DECL void soci_begin(session_handle s); +SOCI_DECL void soci_commit(session_handle s); +SOCI_DECL void soci_rollback(session_handle s); + +SOCI_DECL int soci_session_state(session_handle s); +SOCI_DECL char const * soci_session_error_message(session_handle s); + +// statement + +typedef void * statement_handle; +SOCI_DECL statement_handle soci_create_statement(session_handle s); +SOCI_DECL void soci_destroy_statement(statement_handle st); + +// positional bind of into elments (the functions return the position for convenience) +SOCI_DECL int soci_into_string (statement_handle st); +SOCI_DECL int soci_into_int (statement_handle st); +SOCI_DECL int soci_into_long_long(statement_handle st); +SOCI_DECL int soci_into_double (statement_handle st); +SOCI_DECL int soci_into_date (statement_handle st); + +// vector versions +SOCI_DECL int soci_into_string_v (statement_handle st); +SOCI_DECL int soci_into_int_v (statement_handle st); +SOCI_DECL int soci_into_long_long_v(statement_handle st); +SOCI_DECL int soci_into_double_v (statement_handle st); +SOCI_DECL int soci_into_date_v (statement_handle st); + +// positional read of into elements +SOCI_DECL int soci_get_into_state (statement_handle st, int position); +SOCI_DECL char const * soci_get_into_string (statement_handle st, int position); +SOCI_DECL int soci_get_into_int (statement_handle st, int position); +SOCI_DECL long long soci_get_into_long_long(statement_handle st, int position); +SOCI_DECL double soci_get_into_double (statement_handle st, int position); +SOCI_DECL char const * soci_get_into_date (statement_handle st, int position); + +// positional (re)size of vectors +SOCI_DECL int soci_into_get_size_v(statement_handle st); +SOCI_DECL void soci_into_resize_v (statement_handle st, int new_size); + +// positional read of vectors +SOCI_DECL int soci_get_into_state_v (statement_handle st, int position, int index); +SOCI_DECL char const * soci_get_into_string_v (statement_handle st, int position, int index); +SOCI_DECL int soci_get_into_int_v (statement_handle st, int position, int index); +SOCI_DECL long long soci_get_into_long_long_v(statement_handle st, int position, int index); +SOCI_DECL double soci_get_into_double_v (statement_handle st, int position, int index); +SOCI_DECL char const * soci_get_into_date_v (statement_handle st, int position, int index); + + +// named bind of use elements +SOCI_DECL void soci_use_string (statement_handle st, char const * name); +SOCI_DECL void soci_use_int (statement_handle st, char const * name); +SOCI_DECL void soci_use_long_long(statement_handle st, char const * name); +SOCI_DECL void soci_use_double (statement_handle st, char const * name); +SOCI_DECL void soci_use_date (statement_handle st, char const * name); + +// vector versions +SOCI_DECL void soci_use_string_v (statement_handle st, char const * name); +SOCI_DECL void soci_use_int_v (statement_handle st, char const * name); +SOCI_DECL void soci_use_long_long_v(statement_handle st, char const * name); +SOCI_DECL void soci_use_double_v (statement_handle st, char const * name); +SOCI_DECL void soci_use_date_v (statement_handle st, char const * name); + + +// named write of use elements +SOCI_DECL void soci_set_use_state (statement_handle st, char const * name, int state); +SOCI_DECL void soci_set_use_string (statement_handle st, char const * name, char const * val); +SOCI_DECL void soci_set_use_int (statement_handle st, char const * name, int val); +SOCI_DECL void soci_set_use_long_long(statement_handle st, char const * name, long long val); +SOCI_DECL void soci_set_use_double (statement_handle st, char const * name, double val); +SOCI_DECL void soci_set_use_date (statement_handle st, char const * name, char const * val); + +// positional (re)size of vectors +SOCI_DECL int soci_use_get_size_v(statement_handle st); +SOCI_DECL void soci_use_resize_v (statement_handle st, int new_size); + +// named write of use vectors +SOCI_DECL void soci_set_use_state_v(statement_handle st, + char const * name, int index, int state); +SOCI_DECL void soci_set_use_string_v(statement_handle st, + char const * name, int index, char const * val); +SOCI_DECL void soci_set_use_int_v(statement_handle st, + char const * name, int index, int val); +SOCI_DECL void soci_set_use_long_long_v(statement_handle st, + char const * name, int index, long long val); +SOCI_DECL void soci_set_use_double_v(statement_handle st, + char const * name, int index, double val); +SOCI_DECL void soci_set_use_date_v(statement_handle st, + char const * name, int index, char const * val); + + +// named read of use elements (for modifiable use values) +SOCI_DECL int soci_get_use_state (statement_handle st, char const * name); +SOCI_DECL char const * soci_get_use_string (statement_handle st, char const * name); +SOCI_DECL int soci_get_use_int (statement_handle st, char const * name); +SOCI_DECL long long soci_get_use_long_long(statement_handle st, char const * name); +SOCI_DECL double soci_get_use_double (statement_handle st, char const * name); +SOCI_DECL char const * soci_get_use_date (statement_handle st, char const * name); + + +// statement preparation and execution +SOCI_DECL void soci_prepare(statement_handle st, char const * query); +SOCI_DECL int soci_execute(statement_handle st, int withDataExchange); +SOCI_DECL int soci_fetch(statement_handle st); +SOCI_DECL int soci_got_data(statement_handle st); + +SOCI_DECL int soci_statement_state(statement_handle s); +SOCI_DECL char const * soci_statement_error_message(statement_handle s); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +#endif // SOCI_SIMPLE_H_INCLUDED diff --git a/src/core/soci.cpp b/src/core/soci.cpp deleted file mode 100644 index 057087cd..00000000 --- a/src/core/soci.cpp +++ /dev/null @@ -1,1178 +0,0 @@ -// -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#define SOCI_SOURCE -#include "soci.h" - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif - -using namespace SOCI; -using namespace SOCI::details; - -SOCIError::SOCIError(std::string const & msg) - : std::runtime_error(msg) -{ -} - -Session::Session(BackEndFactory const &factory, - std::string const & connectString) - : once(this), prepare(this), logStream_(NULL) -{ - backEnd_ = factory.makeSession(connectString); -} - -Session::~Session() -{ - delete backEnd_; -} - -void Session::begin() -{ - backEnd_->begin(); -} - -void Session::commit() -{ - backEnd_->commit(); -} - -void Session::rollback() -{ - backEnd_->rollback(); -} - -void Session::setLogStream(std::ostream *s) -{ - logStream_ = s; -} - -std::ostream * Session::getLogStream() const -{ - return logStream_; -} - -void Session::logQuery(std::string const &query) -{ - if (logStream_ != NULL) - { - *logStream_ << query << '\n'; - } - - lastQuery_ = query; -} - -std::string Session::getLastQuery() const -{ - return lastQuery_; -} - -StatementBackEnd * Session::makeStatementBackEnd() -{ - return backEnd_->makeStatementBackEnd(); -} - -RowIDBackEnd * Session::makeRowIDBackEnd() -{ - return backEnd_->makeRowIDBackEnd(); -} - -BLOBBackEnd * Session::makeBLOBBackEnd() -{ - return backEnd_->makeBLOBBackEnd(); -} - -details::StatementImpl::StatementImpl(Session &s) - : session_(s), refCount_(1), row_(0), - fetchSize_(1), initialFetchSize_(1), - alreadyDescribed_(false) -{ - backEnd_ = s.makeStatementBackEnd(); -} - -details::StatementImpl::StatementImpl(PrepareTempType const &prep) - : session_(*prep.getPrepareInfo()->session_), - refCount_(1), row_(0), fetchSize_(1), alreadyDescribed_(false) -{ - backEnd_ = session_.makeStatementBackEnd(); - - RefCountedPrepareInfo *prepInfo = prep.getPrepareInfo(); - - // take all bind/define info - intos_.swap(prepInfo->intos_); - uses_.swap(prepInfo->uses_); - - // allocate handle - alloc(); - - // prepare the statement - query_ = prepInfo->getQuery(); - prepare(query_); - - defineAndBind(); -} - -details::StatementImpl::~StatementImpl() -{ - cleanUp(); -} - -void details::StatementImpl::alloc() -{ - backEnd_->alloc(); -} - -void details::StatementImpl::bind(Values& values) -{ - size_t cnt = 0; - - try - { - for(std::vector<details::StandardUseType*>::iterator it = - values.uses_.begin(); it != values.uses_.end(); ++it) - { - // only bind those variables which are actually - // referenced in the statement - const std::string name = ":" + (*it)->getName(); - - size_t pos = query_.find(name); - if (pos != std::string::npos) - { - const char nextChar = query_[pos + name.size()]; - if(nextChar == ' ' || nextChar == ',' || - nextChar == '\0' || nextChar == ')') - { - int position = static_cast<int>(uses_.size()); - (*it)->bind(*this, position); - uses_.push_back(*it); - indicators_.push_back(values.indicators_[cnt]); - } - else - { - values.addUnused(*it, values.indicators_[cnt]); - } - } - else - { - values.addUnused(*it, values.indicators_[cnt]); - } - - cnt++; - } - } - catch(...) - { - for(size_t i = ++cnt; i != values.uses_.size(); ++i) - { - values.addUnused(uses_[i], values.indicators_[i]); - } - throw; - } -} - - -void details::StatementImpl::exchange(IntoTypePtr const &i) -{ - intos_.push_back(i.get()); - i.release(); -} - -void details::StatementImpl::exchangeForRow(IntoTypePtr const &i) -{ - intosForRow_.push_back(i.get()); - i.release(); -} - -void details::StatementImpl::exchangeForRowset(IntoTypePtr const &i) -{ - if (!intos_.empty()) - { - throw SOCIError("Explicit into elements not allowed with rowset."); - } - - IntoTypeBase *p = i.get(); - intos_.push_back(p); - i.release(); - - int definePosition = 1; - p->define(*this, definePosition); - definePositionForRow_ = definePosition; -} - -void details::StatementImpl::exchange(UseTypePtr const &u) -{ - uses_.push_back(u.get()); - u.release(); -} - -void details::StatementImpl::cleanUp() -{ - // deallocate all bind and define objects - std::size_t const isize = intos_.size(); - for (std::size_t i = isize; i != 0; --i) - { - intos_[i - 1]->cleanUp(); - delete intos_[i - 1]; - intos_.resize(i - 1); - } - - std::size_t const ifrsize = intosForRow_.size(); - for (std::size_t i = ifrsize; i != 0; --i) - { - intosForRow_[i - 1]->cleanUp(); - delete intosForRow_[i - 1]; - intosForRow_.resize(i - 1); - } - - std::size_t const usize = uses_.size(); - for (std::size_t i = usize; i != 0; --i) - { - uses_[i - 1]->cleanUp(); - delete uses_[i - 1]; - uses_.resize(i - 1); - } - - std::size_t const indsize = indicators_.size(); - for (std::size_t i = 0; i != indsize; ++i) - { - delete indicators_[i]; - indicators_[i] = NULL; - } - - if (backEnd_ != NULL) - { - backEnd_->cleanUp(); - delete backEnd_; - backEnd_ = NULL; - } -} - -void details::StatementImpl::prepare(std::string const &query, - details::eStatementType eType) -{ - query_ = query; - session_.logQuery(query); - - backEnd_->prepare(query, eType); -} - -void details::StatementImpl::defineAndBind() -{ - int definePosition = 1; - std::size_t const isize = intos_.size(); - for (std::size_t i = 0; i != isize; ++i) - { - intos_[i]->define(*this, definePosition); - } - - // if there are some implicite into elements - // injected by the row description process, - // they should be defined in the later phase, - // starting at the position where the above loop finished - definePositionForRow_ = definePosition; - - int bindPosition = 1; - std::size_t const usize = uses_.size(); - for (std::size_t i = 0; i != usize; ++i) - { - uses_[i]->bind(*this, bindPosition); - } -} - -void details::StatementImpl::defineForRow() -{ - std::size_t const isize = intosForRow_.size(); - for (std::size_t i = 0; i != isize; ++i) - { - intosForRow_[i]->define(*this, definePositionForRow_); - } -} - -void details::StatementImpl::unDefAndBind() -{ - std::size_t const isize = intos_.size(); - for (std::size_t i = isize; i != 0; --i) - { - intos_[i - 1]->cleanUp(); - } - - std::size_t const ifrsize = intosForRow_.size(); - for (std::size_t i = ifrsize; i != 0; --i) - { - intosForRow_[i - 1]->cleanUp(); - } - - std::size_t const usize = uses_.size(); - for (std::size_t i = usize; i != 0; --i) - { - uses_[i - 1]->cleanUp(); - } -} - -bool details::StatementImpl::execute(bool withDataExchange) -{ - initialFetchSize_ = intosSize(); - fetchSize_ = initialFetchSize_; - - std::size_t bindSize = usesSize(); - - if (bindSize > 1 && fetchSize_ > 1) - { - throw SOCIError( - "Bulk insert/update and bulk select not allowed in same query"); - } - - preUse(); - - // looks like a hack and it is - row description should happen - // *after* the use elements were completely prepared - // and *before* the into elements are touched, so that the row - // description process can inject more into elements for - // implicit data exchange - if (row_ != NULL && alreadyDescribed_ == false) - { - describe(); - defineForRow(); - } - - int num = 0; - if (withDataExchange) - { - num = 1; - - preFetch(); - - if (static_cast<int>(fetchSize_) > num) - { - num = static_cast<int>(fetchSize_); - } - if (static_cast<int>(bindSize) > num) - { - num = static_cast<int>(bindSize); - } - } - - StatementBackEnd::execFetchResult res = backEnd_->execute(num); - - bool gotData = false; - - if (res == StatementBackEnd::eSuccess) - { - // the "success" means that the statement executed correctly - // and for select statement this also means that some rows were read - - if (num > 0) - { - gotData = true; - - // ensure into vectors have correct size - resizeIntos(static_cast<std::size_t>(num)); - } - } - else // res == eNoData - { - // the "no data" means that the end-of-rowset condition was hit - // but still some rows might have been read (the last bunch of rows) - // it can also mean that the statement did not produce any results - - gotData = fetchSize_ > 1 ? resizeIntos() : false; - } - - if (num > 0) - { - postFetch(gotData, false); - postUse(gotData); - } - - return gotData; -} - -bool details::StatementImpl::fetch() -{ - if (fetchSize_ == 0) - { - return false; - } - - bool gotData = false; - - // vectors might have been resized between fetches - std::size_t newFetchSize = intosSize(); - if (newFetchSize > initialFetchSize_) - { - // this is not allowed, because most likely caused reallocation - // of the vector - this would require complete re-bind - - throw SOCIError( - "Increasing the size of the output vector is not supported."); - } - else if (newFetchSize == 0) - { - return false; - } - else - { - // the output vector was downsized or remains the same as before - fetchSize_ = newFetchSize; - } - - StatementBackEnd::execFetchResult res = - backEnd_->fetch(static_cast<int>(fetchSize_)); - if (res == StatementBackEnd::eSuccess) - { - // the "success" means that some number of rows was read - // and that it is not yet the end-of-rowset (there are more rows) - - gotData = true; - - // ensure into vectors have correct size - resizeIntos(fetchSize_); - } - else // res == eNoData - { - // end-of-rowset condition - - if (fetchSize_ > 1) - { - // but still the last bunch of rows might have been read - gotData = resizeIntos(); - fetchSize_ = 0; - } - else - { - gotData = false; - } - } - - postFetch(gotData, true); - return gotData; -} - -std::size_t details::StatementImpl::intosSize() -{ - // this function does not need to take into account intosForRow_ elements, - // since their sizes are always 1 (which is the same and the primary - // into(row) element, which has injected them) - - std::size_t intosSize = 0; - std::size_t const isize = intos_.size(); - for (std::size_t i = 0; i != isize; ++i) - { - if (i==0) - { - intosSize = intos_[i]->size(); - if (intosSize == 0) - { - // this can happen only for vectors - throw SOCIError("Vectors of size 0 are not allowed."); - } - } - else if (intosSize != intos_[i]->size()) - { - std::ostringstream msg; - msg << "Bind variable size mismatch (into[" - << static_cast<unsigned long>(i) << "] has size " - << static_cast<unsigned long>(intos_[i]->size()) - << ", into[0] has size " - << static_cast<unsigned long>(intosSize); - throw SOCIError(msg.str()); - } - } - return intosSize; -} - -std::size_t details::StatementImpl::usesSize() -{ - std::size_t usesSize = 0; - std::size_t const usize = uses_.size(); - for (std::size_t i = 0; i != usize; ++i) - { - if (i==0) - { - usesSize = uses_[i]->size(); - if (usesSize == 0) - { - // this can happen only for vectors - throw SOCIError("Vectors of size 0 are not allowed."); - } - } - else if (usesSize != uses_[i]->size()) - { - std::ostringstream msg; - msg << "Bind variable size mismatch (use[" - << static_cast<unsigned long>(i) << "] has size " - << static_cast<unsigned long>(uses_[i]->size()) - << ", use[0] has size " - << static_cast<unsigned long>(usesSize); - throw SOCIError(msg.str()); - } - } - return usesSize; -} - -bool details::StatementImpl::resizeIntos(std::size_t upperBound) -{ - // this function does not need to take into account the intosForRow_ - // elements, since they are never used for bulk operations - - std::size_t rows = backEnd_->getNumberOfRows(); - if (upperBound != 0 && upperBound < rows) - { - rows = upperBound; - } - - std::size_t const isize = intos_.size(); - for (std::size_t i = 0; i != isize; ++i) - { - intos_[i]->resize(rows); - } - - return rows > 0 ? true : false; -} - -void details::StatementImpl::preFetch() -{ - std::size_t const isize = intos_.size(); - for (std::size_t i = 0; i != isize; ++i) - { - intos_[i]->preFetch(); - } - - std::size_t const ifrsize = intosForRow_.size(); - for (std::size_t i = 0; i != ifrsize; ++i) - { - intosForRow_[i]->preFetch(); - } -} - -void details::StatementImpl::preUse() -{ - std::size_t const usize = uses_.size(); - for (std::size_t i = 0; i != usize; ++i) - { - uses_[i]->preUse(); - } -} - -void details::StatementImpl::postFetch(bool gotData, bool calledFromFetch) -{ - // first iterate over intosForRow_ elements, since the Row element - // (which is among the intos_ elements) might depend on the - // values of those implicitly injected elements - - std::size_t const ifrsize = intosForRow_.size(); - for (std::size_t i = 0; i != ifrsize; ++i) - { - intosForRow_[i]->postFetch(gotData, calledFromFetch); - } - - std::size_t const isize = intos_.size(); - for (std::size_t i = 0; i != isize; ++i) - { - intos_[i]->postFetch(gotData, calledFromFetch); - } -} - -void details::StatementImpl::postUse(bool gotData) -{ - // iterate in reverse order here in case the first item - // is an UseType<Values> (since it depends on the other UseTypes) - for (std::size_t i = uses_.size(); i != 0; --i) - { - uses_[i-1]->postUse(gotData); - } -} - -details::StandardIntoTypeBackEnd * -details::StatementImpl::makeIntoTypeBackEnd() -{ - return backEnd_->makeIntoTypeBackEnd(); -} - -details::StandardUseTypeBackEnd * -details::StatementImpl::makeUseTypeBackEnd() -{ - return backEnd_->makeUseTypeBackEnd(); -} - -details::VectorIntoTypeBackEnd * -details::StatementImpl::makeVectorIntoTypeBackEnd() -{ - return backEnd_->makeVectorIntoTypeBackEnd(); -} - -details::VectorUseTypeBackEnd * -details::StatementImpl::makeVectorUseTypeBackEnd() -{ - return backEnd_->makeVectorUseTypeBackEnd(); -} - -void details::StatementImpl::incRef() -{ - ++refCount_; -} - -void details::StatementImpl::decRef() -{ - if (--refCount_ == 0) - { - delete this; - } -} - -// Map eDataTypes to stock types for dynamic result set support -namespace SOCI -{ -namespace details -{ - -template<> -void StatementImpl::bindInto<eString>() -{ - intoRow<std::string>(); -} - -template<> -void StatementImpl::bindInto<eDouble>() -{ - intoRow<double>(); -} - -template<> -void StatementImpl::bindInto<eInteger>() -{ - intoRow<int>(); -} - -template<> -void StatementImpl::bindInto<eUnsignedLong>() -{ - intoRow<unsigned long>(); -} - -template<> -void StatementImpl::bindInto<eDate>() -{ - intoRow<std::tm>(); -} - -} // namespace details - -} //namespace SOCI - -void details::StatementImpl::describe() -{ - int numcols = backEnd_->prepareForDescribe(); - - for (int i = 1; i <= numcols; ++i) - { - eDataType dtype; - std::string columnName; - - backEnd_->describeColumn(i, dtype, columnName); - - ColumnProperties props; - props.setName(columnName); - - props.setDataType(dtype); - switch(dtype) - { - case eString: - bindInto<eString>(); - break; - case eDouble: - bindInto<eDouble>(); - break; - case eInteger: - bindInto<eInteger>(); - break; - case eUnsignedLong: - bindInto<eUnsignedLong>(); - break; - case eDate: - bindInto<eDate>(); - break; - default: - std::ostringstream msg; - msg << "db column type " << dtype - <<" not supported for dynamic selects"<<std::endl; - throw SOCIError(msg.str()); - } - row_->addProperties(props); - } - - alreadyDescribed_ = true; -} - -void details::StatementImpl::setRow(Row *r) -{ - if (row_ != NULL) - { - throw SOCIError( - "Only one Row element allowed in a single statement."); - } - - row_ = r; -} - -std::string details::StatementImpl::rewriteForProcedureCall(std::string const &query) -{ - return backEnd_->rewriteForProcedureCall(query); -} - -details::ProcedureImpl::ProcedureImpl(PrepareTempType const &prep) - : StatementImpl(*prep.getPrepareInfo()->session_) -{ - RefCountedPrepareInfo *prepInfo = prep.getPrepareInfo(); - - // take all bind/define info - intos_.swap(prepInfo->intos_); - uses_.swap(prepInfo->uses_); - - // allocate handle - alloc(); - - // prepare the statement - prepare(rewriteForProcedureCall(prepInfo->getQuery())); - - defineAndBind(); -} - -void RefCountedStatement::finalAction() -{ - try - { - st_.alloc(); - st_.prepare(query_.str(), details::eOneTimeQuery); - st_.defineAndBind(); - st_.execute(true); - } - catch (...) - { - st_.cleanUp(); - throw; - } - - st_.cleanUp(); -} - -void RefCountedPrepareInfo::exchange(IntoTypePtr const &i) -{ - intos_.push_back(i.get()); - i.release(); -} - -void RefCountedPrepareInfo::exchange(UseTypePtr const &u) -{ - uses_.push_back(u.get()); - u.release(); -} - -void RefCountedPrepareInfo::finalAction() -{ - // deallocate all bind and define objects - for (std::size_t i = intos_.size(); i > 0; --i) - { - delete intos_[i - 1]; - intos_.resize(i - 1); - } - - for (std::size_t i = uses_.size(); i > 0; --i) - { - delete uses_[i - 1]; - uses_.resize(i - 1); - } -} - -OnceTempType::OnceTempType(Session &s) - : rcst_(new RefCountedStatement(s)) -{ -} - -OnceTempType::OnceTempType(OnceTempType const &o) - :rcst_(o.rcst_) -{ - rcst_->incRef(); -} - -OnceTempType & OnceTempType::operator=(OnceTempType const &o) -{ - o.rcst_->incRef(); - rcst_->decRef(); - rcst_ = o.rcst_; - - return *this; -} - -OnceTempType::~OnceTempType() -{ - rcst_->decRef(); -} - -OnceTempType & OnceTempType::operator,(IntoTypePtr const &i) -{ - rcst_->exchange(i); - return *this; -} - -OnceTempType & OnceTempType::operator,(UseTypePtr const &u) -{ - rcst_->exchange(u); - return *this; -} - -PrepareTempType::PrepareTempType(Session &s) - : rcpi_(new RefCountedPrepareInfo(s)) -{ -} - -PrepareTempType::PrepareTempType(PrepareTempType const &o) - :rcpi_(o.rcpi_) -{ - rcpi_->incRef(); -} - -PrepareTempType & PrepareTempType::operator=(PrepareTempType const &o) -{ - o.rcpi_->incRef(); - rcpi_->decRef(); - rcpi_ = o.rcpi_; - - return *this; -} - -PrepareTempType::~PrepareTempType() -{ - rcpi_->decRef(); -} - -PrepareTempType & PrepareTempType::operator,(IntoTypePtr const &i) -{ - rcpi_->exchange(i); - return *this; -} - -PrepareTempType & PrepareTempType::operator,(UseTypePtr const &u) -{ - rcpi_->exchange(u); - return *this; -} - -void Row::addProperties(ColumnProperties const &cp) -{ - columns_.push_back(cp); - index_[cp.getName()] = columns_.size() - 1; -} - -std::size_t Row::size() const -{ - return holders_.size(); -} - -eIndicator Row::indicator(std::size_t pos) const -{ - assert(indicators_.size() >= static_cast<std::size_t>(pos + 1)); - return *indicators_[pos]; -} - -eIndicator Row::indicator(std::string const &name) const -{ - return indicator(findColumn(name)); -} - -ColumnProperties const & Row::getProperties(std::size_t pos) const -{ - assert(columns_.size() >= pos + 1); - return columns_[pos]; -} - -ColumnProperties const & Row::getProperties(std::string const &name) const -{ - return getProperties(findColumn(name)); -} - -std::size_t Row::findColumn(std::string const &name) const -{ - std::map<std::string, std::size_t>::const_iterator it = index_.find(name); - if (it == index_.end()) - { - std::ostringstream msg; - msg << "Column '" << name << "' not found"; - throw SOCIError(msg.str()); - } - - return it->second; -} - -Row::~Row() -{ - std::size_t const hsize = holders_.size(); - for(std::size_t i = 0; i != hsize; ++i) - { - delete holders_[i]; - delete indicators_[i]; - } -} - -eIndicator Values::indicator(std::size_t pos) const -{ - if (row_) - { - return row_->indicator(pos); - } - else - { - return *indicators_[pos]; - } -} - -eIndicator Values::indicator(std::string const &name) const -{ - if (row_) - { - return row_->indicator(name); - } - else - { - std::map<std::string, std::size_t>::const_iterator it = index_.find(name); - if (it == index_.end()) - { - std::ostringstream msg; - msg << "Column '" << name << "' not found"; - throw SOCIError(msg.str()); - } - return *indicators_[it->second]; - } -} - - -// implementation of into and use types - -// standard types - -StandardIntoType::~StandardIntoType() -{ - delete backEnd_; -} - -void StandardIntoType::define(StatementImpl &st, int &position) -{ - backEnd_ = st.makeIntoTypeBackEnd(); - backEnd_->defineByPos(position, data_, type_); -} - -void StandardIntoType::preFetch() -{ - backEnd_->preFetch(); -} - -void StandardIntoType::postFetch(bool gotData, bool calledFromFetch) -{ - backEnd_->postFetch(gotData, calledFromFetch, ind_); - - if (gotData) - { - convertFrom(); - } -} - -void StandardIntoType::cleanUp() -{ - // backEnd_ might be NULL if IntoType<Row> was used - if (backEnd_ != NULL) - { - backEnd_->cleanUp(); - } -} - -StandardUseType::~StandardUseType() -{ - delete backEnd_; -} - -void StandardUseType::bind(StatementImpl &st, int &position) -{ - backEnd_ = st.makeUseTypeBackEnd(); - if (name_.empty()) - { - backEnd_->bindByPos(position, data_, type_); - } - else - { - backEnd_->bindByName(name_, data_, type_); - } -} - -void StandardUseType::preUse() -{ - convertTo(); - backEnd_->preUse(ind_); -} - -void StandardUseType::postUse(bool gotData) -{ - backEnd_->postUse(gotData, ind_); - - convertFrom(); -} - -void StandardUseType::cleanUp() -{ - if (backEnd_ != NULL) - { - backEnd_->cleanUp(); - } -} - -// vector based types - -VectorIntoType::~VectorIntoType() -{ - delete backEnd_; -} - -void VectorIntoType::define(StatementImpl &st, int &position) -{ - backEnd_ = st.makeVectorIntoTypeBackEnd(); - backEnd_->defineByPos(position, data_, type_); -} - -void VectorIntoType::preFetch() -{ - backEnd_->preFetch(); -} - -void VectorIntoType::postFetch(bool gotData, bool /* calledFromFetch */) -{ - if (indVec_ != NULL && indVec_->empty() == false) - { - assert(indVec_->empty() == false); - backEnd_->postFetch(gotData, &(*indVec_)[0]); - } - else - { - backEnd_->postFetch(gotData, NULL); - } - - if(gotData) - { - convertFrom(); - } -} - -void VectorIntoType::resize(std::size_t sz) -{ - if (indVec_ != NULL) - { - indVec_->resize(sz); - } - - backEnd_->resize(sz); -} - -std::size_t VectorIntoType::size() const -{ - return backEnd_->size(); -} - -void VectorIntoType::cleanUp() -{ - if (backEnd_ != NULL) - { - backEnd_->cleanUp(); - } -} - -VectorUseType::~VectorUseType() -{ - delete backEnd_; -} - -void VectorUseType::bind(StatementImpl &st, int &position) -{ - backEnd_ = st.makeVectorUseTypeBackEnd(); - if (name_.empty()) - { - backEnd_->bindByPos(position, data_, type_); - } - else - { - backEnd_->bindByName(name_, data_, type_); - } -} - -void VectorUseType::preUse() -{ - convertTo(); - - backEnd_->preUse(ind_); -} - -std::size_t VectorUseType::size() const -{ - return backEnd_->size(); -} - -void VectorUseType::cleanUp() -{ - if (backEnd_ != NULL) - { - backEnd_->cleanUp(); - } -} - - -// basic BLOB operations - -BLOB::BLOB(Session &s) -{ - backEnd_ = s.makeBLOBBackEnd(); -} - -BLOB::~BLOB() -{ - delete backEnd_; -} - -std::size_t BLOB::getLen() -{ - return backEnd_->getLen(); -} - -std::size_t BLOB::read(std::size_t offset, char *buf, std::size_t toRead) -{ - return backEnd_->read(offset, buf, toRead); -} - -std::size_t BLOB::write( - std::size_t offset, char const *buf, std::size_t toWrite) -{ - return backEnd_->write(offset, buf, toWrite); -} - -std::size_t BLOB::append(char const *buf, std::size_t toWrite) -{ - return backEnd_->append(buf, toWrite); -} - -void BLOB::trim(std::size_t newLen) -{ - backEnd_->trim(newLen); -} - -// ROWID support - -RowID::RowID(Session &s) -{ - backEnd_ = s.makeRowIDBackEnd(); -} - -RowID::~RowID() -{ - delete backEnd_; -} diff --git a/src/core/soci.h b/src/core/soci.h index d4acf9cd..5cdb7230 100644 --- a/src/core/soci.h +++ b/src/core/soci.h @@ -1,5 +1,5 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,2211 +8,51 @@ #ifndef SOCI_H_INCLUDED #define SOCI_H_INCLUDED -#include <map> -#include <string> -#include <vector> -#include <ostream> -#include <sstream> -#include <ctime> -#include <cassert> - -#include "soci-config.h" -#include "soci-backend.h" - #ifdef _MSC_VER #pragma warning(disable:4251 4512 4511) #endif -namespace SOCI -{ - -class Session; -class Statement; - - -// default traits class TypeConversion, acts as pass through for Row::get() -// when no actual conversion is needed. -template<typename T> -struct TypeConversion -{ - typedef T base_type; - static T from(T const &t) { return t; } -}; - -// TypeConversion specializations must use a stock type as the base_type. -// Each such specialization automatically creates a UseType and an IntoType. -// This code is commented out, since it causes problems in those environments -// where std::time_t is an alias to int. -// -// template<> -// struct TypeConversion<std::time_t> -// {: -// typedef std::tm base_type; -// static std::time_t from(std::tm& t) { return mktime(&t); } -// static std::tm to(std::time_t& t) { return *localtime(&t); } -// }; - - -namespace details -{ - -class StatementImpl; - -// this is intended to be a base class for all classes that deal with -// defining output data -class IntoTypeBase -{ -public: - virtual ~IntoTypeBase() {} - - virtual void define(details::StatementImpl &st, int &position) = 0; - virtual void preFetch() = 0; - virtual void postFetch(bool gotData, bool calledFromFetch) = 0; - virtual void cleanUp() = 0; - - virtual std::size_t size() const = 0; // returns the number of elements - virtual void resize(std::size_t /* sz */) {} // used for vectors only -}; - -// this is intended to be a base class for all classes that deal with -// binding input data (and OUT PL/SQL variables) -class SOCI_DECL UseTypeBase -{ -public: - virtual ~UseTypeBase() {} - - virtual void bind(details::StatementImpl &st, int &position) = 0; - virtual void preUse() = 0; - virtual void postUse(bool gotData) = 0; - virtual void cleanUp() = 0; - - virtual std::size_t size() const = 0; // returns the number of elements -}; - -template <typename T> -class TypePtr -{ -public: - TypePtr(T *p) : p_(p) {} - ~TypePtr() { delete p_; } - - T * get() const { return p_; } - void release() const { p_ = NULL; } - -private: - mutable T *p_; -}; - -typedef TypePtr<IntoTypeBase> IntoTypePtr; -typedef TypePtr<UseTypeBase> UseTypePtr; - -// general case not implemented -template <typename T> -class IntoType; - -// general case not implemented -template <typename T> -class UseType; - -} // namespace details - - -// the into function is a helper for defining output variables - -template <typename T> -details::IntoTypePtr into(T &t) -{ - return details::IntoTypePtr(new details::IntoType<T>(t)); -} - -template <typename T, typename T1> -details::IntoTypePtr into(T &t, T1 p1) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, p1)); -} - -template <typename T> -details::IntoTypePtr into(T &t, std::vector<eIndicator> &indicator) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, indicator)); -} - -template <typename T> -details::IntoTypePtr into(T &t, eIndicator &indicator) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, indicator)); -} - -template <typename T, typename T1, typename T2> -details::IntoTypePtr into(T &t, T1 p1, T2 p2) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, p1, p2)); -} - -template <typename T, typename T1> -details::IntoTypePtr into(T &t, eIndicator &ind, T1 p1) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, ind, p1)); -} - -template <typename T, typename T1, typename T2, typename T3> -details::IntoTypePtr into(T &t, T1 p1, T2 p2, T3 p3) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, p1, p2, p3)); -} - -template <typename T, typename T1, typename T2> -details::IntoTypePtr into(T &t, eIndicator &ind, T1 p1, T2 p2) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, ind, p1, p2)); -} - -template <typename T, typename T1, typename T2, typename T3, typename T4> -details::IntoTypePtr into(T &t, T1 p1, T2 p2, T3 p3, T4 p4) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, p1, p2, p3, p4)); -} - -template <typename T, typename T1, typename T2, typename T3> -details::IntoTypePtr into(T &t, eIndicator &ind, T1 p1, T2 p2, T3 p3) -{ - return details::IntoTypePtr(new details::IntoType<T>(t, ind, p1, p2, p3)); -} - -template <typename T, typename T1, typename T2, typename T3, - typename T4, typename T5> -details::IntoTypePtr into(T &t, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5) -{ - return details::IntoTypePtr( - new details::IntoType<T>(t, p1, p2, p3, p4, p5)); -} - -template <typename T, typename T1, typename T2, typename T3, typename T4> -details::IntoTypePtr into(T &t, eIndicator &ind, T1 p1, T2 p2, T3 p3, T4 p4) -{ - return details::IntoTypePtr( - new details::IntoType<T>(t, ind, p1, p2, p3, p4)); -} - - -// the use function is a helper for binding input variables -// (and output PL/SQL parameters) - -template <typename T> -details::UseTypePtr use(T &t) -{ - return details::UseTypePtr(new details::UseType<T>(t)); -} - -template <typename T, typename T1> -details::UseTypePtr use(T &t, T1 p1) -{ - return details::UseTypePtr(new details::UseType<T>(t, p1)); -} - -template <typename T> -details::UseTypePtr use(T &t, std::vector<eIndicator> const &indicator) -{ - return details::UseTypePtr(new details::UseType<T>(t, indicator)); -} - -template <typename T> -details::UseTypePtr use(T &t, eIndicator &indicator) -{ - return details::UseTypePtr(new details::UseType<T>(t, indicator)); -} - -template <typename T, typename T1, typename T2> -details::UseTypePtr use(T &t, T1 p1, T2 p2) -{ - return details::UseTypePtr(new details::UseType<T>(t, p1, p2)); -} - -template <typename T, typename T1> -details::UseTypePtr use(T &t, eIndicator &ind, T1 p1) -{ - return details::UseTypePtr(new details::UseType<T>(t, ind, p1)); -} - -template <typename T, typename T1> -details::UseTypePtr use(T &t, std::vector<eIndicator> const &ind, T1 p1) -{ - return details::UseTypePtr(new details::UseType<T>(t, ind, p1)); -} - -template <typename T, typename T1, typename T2, typename T3> -details::UseTypePtr use(T &t, T1 p1, T2 p2, T3 p3) -{ - return details::UseTypePtr(new details::UseType<T>(t, p1, p2, p3)); -} - -template <typename T, typename T1, typename T2> -details::UseTypePtr use(T &t, eIndicator &ind, T1 p1, T2 p2) -{ - return details::UseTypePtr(new details::UseType<T>(t, ind, p1, p2)); -} - -template <typename T, typename T1, typename T2, typename T3, typename T4> -details::UseTypePtr use(T &t, T1 p1, T2 p2, T3 p3, T4 p4) -{ - return details::UseTypePtr(new details::UseType<T>(t, p1, p2, p3, p4)); -} - -template <typename T, typename T1, typename T2, typename T3> -details::UseTypePtr use(T &t, eIndicator &ind, T1 p1, T2 p2, T3 p3) -{ - return details::UseTypePtr(new details::UseType<T>(t, ind, p1, p2, p3)); -} - -template <typename T, typename T1, typename T2, typename T3, - typename T4, typename T5> -details::UseTypePtr use(T &t, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5) -{ - return details::UseTypePtr( - new details::UseType<T>(t, p1, p2, p3, p4, p5)); -} - -template <typename T, typename T1, typename T2, typename T3, typename T4> -details::UseTypePtr use(T &t, eIndicator &ind, T1 p1, T2 p2, T3 p3, T4 p4) -{ - return details::UseTypePtr( - new details::UseType<T>(t, ind, p1, p2, p3, p4)); -} - -namespace details -{ - -class PrepareTempType; - - -// Base class Holder + derived class TypeHolder for storing type data -// instances in a container of Holder objects -template <typename T> -class TypeHolder; - -class Holder -{ -public: - Holder(){} - virtual ~Holder(){}; - template<typename T> - T get() - { - TypeHolder<T>* p = dynamic_cast<TypeHolder<T> *>(this); - if (p) - { - return p->value<T>(); - } - else - { - throw std::bad_cast(); - } - } -private: - template<typename T> T value(); -}; - -template <typename T> -class TypeHolder : public Holder -{ -public: - TypeHolder(T* t) : t_(t) {} - ~TypeHolder() { delete t_; } - - template<typename TVAL> TVAL value() const { return *t_; } -private: - T* t_; -}; - -} // namespace details - - -class SOCI_DECL ColumnProperties -{ - // use getters/setters in case we want to make some - // of the getters lazy in the future -public: - - std::string getName() const { return name_; } - eDataType getDataType() const { return dataType_; } - - void setName(std::string const &name) { name_ = name; } - void setDataType(eDataType dataType) { dataType_ = dataType; } - -private: - std::string name_; - eDataType dataType_; -}; - -class SOCI_DECL Row -{ -public: - - void addProperties(ColumnProperties const &cp); - std::size_t size() const; - - eIndicator indicator(std::size_t pos) const; - eIndicator indicator(std::string const &name) const; - - template <typename T> - inline void addHolder(T* t, eIndicator* ind) - { - holders_.push_back(new details::TypeHolder<T>(t)); - indicators_.push_back(ind); - } - - ColumnProperties const & getProperties (std::size_t pos) const; - ColumnProperties const & getProperties (std::string const &name) const; - - template <typename T> - T get(std::size_t pos) const - { - typedef typename TypeConversion<T>::base_type BASE_TYPE; - - assert(holders_.size() >= pos + 1); - - if (eNull == *indicators_[pos]) - { - throw SOCIError("Column contains NULL value and" - " no default was provided"); - } - - BASE_TYPE baseVal = holders_[pos]->get<BASE_TYPE>(); - return TypeConversion<T>::from(baseVal); - } - - template <typename T> - T get(std::size_t pos, T const &nullValue) const - { - assert(holders_.size() >= pos + 1); - - if (eNull == *indicators_[pos]) - { - return nullValue; - } - - return get<T>(pos); - } - - template <typename T> - T get(std::string const &name) const - { - std::size_t pos = findColumn(name); - - if (eNull == *indicators_[pos]) - { - throw SOCIError("Column '" + name + "' contains NULL value and" - " no default was provided"); - } - - return get<T>(pos); - } - - template <typename T> - T get(std::string const &name, T const &nullValue) const - { - std::size_t pos = findColumn(name); - - if (eNull == *indicators_[pos]) - { - return nullValue; - } - - return get<T>(pos); - } - - template <typename T> - Row const & operator>>(T &value) const - { - value = get<T>(currentPos_); - ++currentPos_; - return *this; - } - - void resetGetCounter() - { - currentPos_ = 0; - } - - Row() : currentPos_(0) {} - ~Row(); - -private: - // copy not supported - Row(Row const &); - Row operator=(Row const &); - - std::size_t findColumn(std::string const &name) const; - - std::vector<ColumnProperties> columns_; - std::vector<details::Holder*> holders_; - std::vector<eIndicator*> indicators_; - std::map<std::string, std::size_t> index_; - - mutable std::size_t currentPos_; -}; - -namespace details -{ - -class PrepareTempType; - -} // namespace details - -class Values; - -namespace details -{ - -class SOCI_DECL StatementImpl -{ -public: - StatementImpl(Session &s); - StatementImpl(details::PrepareTempType const &prep); - ~StatementImpl(); - - void alloc(); - void bind(Values& values); - void exchange(details::IntoTypePtr const &i); - void exchange(details::UseTypePtr const &u); - void cleanUp(); - - void prepare(std::string const &query, - details::eStatementType eType = details::eRepeatableQuery); - void defineAndBind(); - void unDefAndBind(); - bool execute(bool withDataExchange = false); - bool fetch(); - void describe(); - void setRow(Row* r); - void exchangeForRowset(details::IntoTypePtr const &i); - - // for diagnostics and advanced users - // (downcast it to expected back-end statement class) - details::StatementBackEnd * getBackEnd() { return backEnd_; } - - details::StandardIntoTypeBackEnd * makeIntoTypeBackEnd(); - details::StandardUseTypeBackEnd * makeUseTypeBackEnd(); - details::VectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd(); - details::VectorUseTypeBackEnd * makeVectorUseTypeBackEnd(); - - void incRef(); - void decRef(); - - Session &session_; - - std::string rewriteForProcedureCall(std::string const &query); - -protected: - std::vector<details::IntoTypeBase*> intos_; - std::vector<details::UseTypeBase*> uses_; - std::vector<eIndicator*> indicators_; - -private: - - int refCount_; - - Row* row_; - std::size_t fetchSize_; - std::size_t initialFetchSize_; - std::string query_; - std::map<std::string, details::UseTypeBase*> namedUses_; - - std::vector<details::IntoTypeBase*> intosForRow_; - int definePositionForRow_; - - void exchangeForRow(details::IntoTypePtr const &i); - void defineForRow(); - - template<typename T> - void intoRow() - { - T* t = new T(); - eIndicator* ind = new eIndicator(eOK); - row_->addHolder(t, ind); - exchangeForRow(into(*t, *ind)); - } - - template<eDataType> void bindInto(); - - bool alreadyDescribed_; - - std::size_t intosSize(); - std::size_t usesSize(); - void preFetch(); - void preUse(); - void postFetch(bool gotData, bool calledFromFetch); - void postUse(bool gotData); - bool resizeIntos(std::size_t upperBound = 0); - - details::StatementBackEnd *backEnd_; -}; - -} // namespace details - -// Statement is a handle class for StatementImpl -// (this provides copyability to otherwise non-copyable type) -class SOCI_DECL Statement -{ -public: - Statement(Session &s) - : impl_(new details::StatementImpl(s)) {} - Statement(details::PrepareTempType const &prep) - : impl_(new details::StatementImpl(prep)) {} - ~Statement() { impl_->decRef(); } - - // copy is supported for this handle class - Statement(Statement const &other) - : impl_(other.impl_) - { - impl_->incRef(); - } - - void operator=(Statement const &other) - { - other.impl_->incRef(); - impl_->decRef(); - impl_ = other.impl_; - } - - void alloc() { impl_->alloc(); } - void bind(Values& values) { impl_->bind(values); } - void exchange(details::IntoTypePtr const &i) { impl_->exchange(i); } - void exchange(details::UseTypePtr const &u) { impl_->exchange(u); } - void cleanUp() { impl_->cleanUp(); } - - void prepare(std::string const &query, - details::eStatementType eType = details::eRepeatableQuery) - { - impl_->prepare(query, eType); - } - - void defineAndBind() { impl_->defineAndBind(); } - void unDefAndBind() { impl_->unDefAndBind(); } - bool execute(bool withDataExchange = false) - { - return impl_->execute(withDataExchange); - } - - bool fetch() { return impl_->fetch(); } - void describe() { impl_->describe(); } - void setRow(Row* r) { impl_->setRow(r); } - void exchangeForRowset(details::IntoTypePtr const &i) - { - impl_->exchangeForRowset(i); - } - - // for diagnostics and advanced users - // (downcast it to expected back-end statement class) - details::StatementBackEnd * getBackEnd() - { - return impl_->getBackEnd(); - } - - details::StandardIntoTypeBackEnd * makeIntoTypeBackEnd() - { - return impl_->makeIntoTypeBackEnd(); - } - - details::StandardUseTypeBackEnd * makeUseTypeBackEnd() - { - return impl_->makeUseTypeBackEnd(); - } - - details::VectorIntoTypeBackEnd * makeVectorIntoTypeBackEnd() - { - return impl_->makeVectorIntoTypeBackEnd(); - } - - details::VectorUseTypeBackEnd * makeVectorUseTypeBackEnd() - { - return impl_->makeVectorUseTypeBackEnd(); - } - - std::string rewriteForProcedureCall(std::string const &query) - { - return impl_->rewriteForProcedureCall(query); - } - -private: - details::StatementImpl * impl_; -}; - -namespace details -{ - -class ProcedureImpl : public StatementImpl -{ -public: - ProcedureImpl(Session &s) : StatementImpl(s), refCount_(1) {} - ProcedureImpl(details::PrepareTempType const &prep); - - void incRef() { ++refCount_; } - void decDef() - { - if (--refCount_) - { - delete this; - } - } - -private: - int refCount_; -}; - -} // namespace details - -class SOCI_DECL Procedure -{ -public: - Procedure(Session &s) - : impl_(new details::ProcedureImpl(s)) {} - Procedure(details::PrepareTempType const &prep) - : impl_(new details::ProcedureImpl(prep)) {} - ~Procedure() { impl_->decRef(); } - - // copy is supported here - Procedure(Procedure const &other) - : impl_(other.impl_) - { - impl_->incRef(); - } - void operator=(Procedure const &other) - { - other.impl_->incRef(); - impl_->decRef(); - impl_ = other.impl_; - } - - // forwarders to ProcedureImpl - // (or rather to its base interface from StatementImpl) - - bool execute(bool withDataExchange = false) - { - return impl_->execute(withDataExchange); - } - - bool fetch() - { - return impl_->fetch(); - } - -private: - details::ProcedureImpl * impl_; -}; - - -namespace details -{ -// this class is a base for both "once" and "prepare" statements -class RefCountedStBase -{ -public: - RefCountedStBase() : refCount_(1) {} - virtual ~RefCountedStBase() {} - - virtual void finalAction() = 0; - - void incRef() { ++refCount_; } - void decRef() - { - if (--refCount_ == 0) - { - try - { - finalAction(); - } - catch (...) - { - delete this; - throw; - } - - delete this; - } - } - - // TODO - mloskot: Consider to wrap conversion with try-catch - template <typename T> - void accumulate(T const &t) { query_ << t; } - -protected: - RefCountedStBase(RefCountedStBase const &); - RefCountedStBase & operator=(RefCountedStBase const &); - - int refCount_; - std::ostringstream query_; -}; - -// this class is supposed to be a vehicle for the "once" statements -// it executes the whole statement in its destructor -class RefCountedStatement : public RefCountedStBase -{ -public: - RefCountedStatement(Session &s) : st_(s) {} - - void exchange(IntoTypePtr const &i) { st_.exchange(i); } - void exchange(UseTypePtr const &u) { st_.exchange(u); } - - virtual void finalAction(); - -private: - Statement st_; -}; - -// this class conveys only the statement text and the bind/define info -// it exists only to be passed to Statement's constructor -class RefCountedPrepareInfo : public RefCountedStBase -{ -public: - RefCountedPrepareInfo(Session &s) : session_(&s) {} - - void exchange(IntoTypePtr const &i); - void exchange(UseTypePtr const &u); - - virtual void finalAction(); - -private: - friend class SOCI::details::StatementImpl; - friend class SOCI::details::ProcedureImpl; - - Session *session_; - - std::vector<IntoTypeBase*> intos_; - std::vector<UseTypeBase*> uses_; - - std::string getQuery() const { return query_.str(); } -}; - -// this needs to be lightweight and copyable -class SOCI_DECL PrepareTempType -{ -public: - PrepareTempType(Session &); - PrepareTempType(PrepareTempType const &); - PrepareTempType & operator=(PrepareTempType const &); - - ~PrepareTempType(); - - template <typename T> - PrepareTempType & operator<<(T const &t) - { - rcpi_->accumulate(t); - return *this; - } - - PrepareTempType & operator,(IntoTypePtr const &i); - PrepareTempType & operator,(UseTypePtr const &u); - - RefCountedPrepareInfo * getPrepareInfo() const { return rcpi_; } - -private: - RefCountedPrepareInfo *rcpi_; -}; - -// this needs to be lightweight and copyable -class SOCI_DECL OnceTempType -{ -public: - - OnceTempType(Session &s); - OnceTempType(OnceTempType const &o); - OnceTempType & operator=(OnceTempType const &o); - - ~OnceTempType(); - - template <typename T> - OnceTempType & operator<<(T const &t) - { - rcst_->accumulate(t); - return *this; - } - - OnceTempType & operator,(IntoTypePtr const &); - OnceTempType & operator,(UseTypePtr const &); - -private: - RefCountedStatement *rcst_; -}; - -// this needs to be lightweight and copyable -class OnceType -{ -public: - OnceType(Session *s) : session_(s) {} - - template <typename T> - OnceTempType operator<<(T const &t) - { - OnceTempType o(*session_); - o << t; - return o; - } - -private: - Session *session_; -}; - - -// this needs to be lightweight and copyable -class PrepareType -{ -public: - PrepareType(Session *s) : session_(s) {} - - template <typename T> - PrepareTempType operator<<(T const &t) - { - PrepareTempType p(*session_); - p << t; - return p; - } - -private: - Session *session_; -}; - -} // namespace details - - -class SOCI_DECL Session -{ -public: - Session(BackEndFactory const &factory, std::string const & connectString); - - ~Session(); - - void begin(); - void commit(); - void rollback(); - - // once and prepare are for syntax sugar only - details::OnceType once; - details::PrepareType prepare; - - // even more sugar - template <typename T> - details::OnceTempType operator<<(T const &t) { return once << t; } - - // support for basic logging - void setLogStream(std::ostream *s); - std::ostream * getLogStream() const; - - void logQuery(std::string const &query); - std::string getLastQuery() const; - - // for diagnostics and advanced users - // (downcast it to expected back-end session class) - details::SessionBackEnd * getBackEnd() { return backEnd_; } - - details::StatementBackEnd * makeStatementBackEnd(); - details::RowIDBackEnd * makeRowIDBackEnd(); - details::BLOBBackEnd * makeBLOBBackEnd(); - -private: - Session(Session const &); - Session& operator=(Session const &); - - std::ostream *logStream_; - std::string lastQuery_; - - details::SessionBackEnd *backEnd_; -}; - - -namespace details -{ - -// template specializations for bind and define operations - -// standard types - -class SOCI_DECL StandardIntoType : public IntoTypeBase -{ -public: - StandardIntoType(void *data, eExchangeType type) - : data_(data), type_(type), ind_(NULL), backEnd_(NULL) {} - StandardIntoType(void *data, eExchangeType type, eIndicator& ind) - : data_(data), type_(type), ind_(&ind), backEnd_(NULL) {} - - virtual ~StandardIntoType(); - -private: - virtual void define(StatementImpl &st, int &position); - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch); - virtual void cleanUp(); - - virtual std::size_t size() const { return 1; } - - // conversion hook (from base type to arbitrary user type) - virtual void convertFrom() {} - - void *data_; - eExchangeType type_; - eIndicator *ind_; - - details::StandardIntoTypeBackEnd *backEnd_; -}; - -class SOCI_DECL StandardUseType : public UseTypeBase -{ -public: - StandardUseType(void *data, eExchangeType type, - std::string const &name = std::string()) - : data_(data), type_(type), ind_(NULL), name_(name), backEnd_(NULL) {} - StandardUseType(void *data, eExchangeType type, eIndicator &ind, - std::string const &name = std::string()) - : data_(data), type_(type), ind_(&ind), name_(name), backEnd_(NULL) {} - - virtual ~StandardUseType(); - virtual void bind(details::StatementImpl &st, int &position); - std::string getName() const {return name_;} - virtual void* getData() {return data_;} - - // conversion hook (from arbitrary user type to base type) - virtual void convertTo() {} - virtual void convertFrom() {} - -private: - virtual void preUse(); - virtual void postUse(bool gotData); - virtual void cleanUp(); - virtual std::size_t size() const { return 1; } - - void *data_; - eExchangeType type_; - eIndicator *ind_; - std::string name_; - - details::StandardUseTypeBackEnd *backEnd_; -}; - -// into and use type base classes for vectors - -class SOCI_DECL VectorIntoType : public IntoTypeBase -{ -public: - VectorIntoType(void *data, eExchangeType type) - : data_(data), type_(type), indVec_(NULL), backEnd_(NULL) {} - - VectorIntoType(void *data, eExchangeType type, - std::vector<eIndicator> &ind) - : data_(data), type_(type), indVec_(&ind), backEnd_(NULL) {} - - ~VectorIntoType(); - -private: - virtual void define(details::StatementImpl &st, int &position); - virtual void preFetch(); - virtual void postFetch(bool gotData, bool calledFromFetch); - virtual void cleanUp(); - virtual void resize(std::size_t sz); - virtual std::size_t size() const; - - void *data_; - eExchangeType type_; - std::vector<eIndicator> *indVec_; - - details::VectorIntoTypeBackEnd *backEnd_; - - virtual void convertFrom() {} -}; - -class SOCI_DECL VectorUseType : public UseTypeBase -{ -public: - VectorUseType(void *data, eExchangeType type, - std::string const &name = std::string()) - : data_(data), type_(type), ind_(NULL), - name_(name), backEnd_(NULL) {} - - VectorUseType(void *data, eExchangeType type, - std::vector<eIndicator> const &ind, - std::string const &name = std::string()) - : data_(data), type_(type), ind_(&ind.at(0)), - name_(name), backEnd_(NULL) {} - - ~VectorUseType(); - -private: - virtual void bind(details::StatementImpl &st, int &position); - virtual void preUse(); - virtual void postUse(bool) { /* nothing to do */ } - virtual void cleanUp(); - virtual std::size_t size() const; - - void *data_; - eExchangeType type_; - eIndicator const *ind_; - std::string name_; - - details::VectorUseTypeBackEnd *backEnd_; - - virtual void convertTo() {} -}; - - -// into and use types for short - -template <> -class IntoType<short> : public StandardIntoType -{ -public: - IntoType(short &s) : StandardIntoType(&s, eXShort) {} - IntoType(short &s, eIndicator &ind) - : StandardIntoType(&s, eXShort, ind) {} -}; - -template <> -class UseType<short> : public StandardUseType -{ -public: - UseType(short &s, std::string const &name = std::string()) - : StandardUseType(&s, eXShort, name) {} - UseType(short &s, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&s, eXShort, ind, name) {} -}; - -// into and use types for std::vector<short> - -template <> -class IntoType<std::vector<short> > : public VectorIntoType -{ -public: - IntoType(std::vector<short> &v) : VectorIntoType(&v, eXShort) {} - IntoType(std::vector<short> &v, std::vector<eIndicator> &ind) - : VectorIntoType(&v, eXShort, ind) {} -}; - -template <> -class UseType<std::vector<short> > : public VectorUseType -{ -public: - UseType(std::vector<short> &v, std::string const &name = std::string()) - : VectorUseType(&v, eXShort, name) {} - UseType(std::vector<short> &v, std::vector<eIndicator> const &ind, - std::string const &name = std::string()) - : VectorUseType(&v, eXShort, ind, name) {} -}; - -// into and use types for int - -template <> -class IntoType<int> : public StandardIntoType -{ -public: - IntoType(int &i) : StandardIntoType(&i, eXInteger) {} - IntoType(int &i, eIndicator &ind) - : StandardIntoType(&i, eXInteger, ind) {} -}; - -template <> -class UseType<int> : public StandardUseType -{ -public: - UseType(int &i, std::string const &name = std::string()) - : StandardUseType(&i, eXInteger, name) {} - UseType(int &i, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&i, eXInteger, ind, name) {} -}; - -// into and use types for std::vector<int> - -template <> -class IntoType<std::vector<int> > : public VectorIntoType -{ -public: - IntoType(std::vector<int> &v) : VectorIntoType(&v, eXInteger) {} - IntoType(std::vector<int> &v, std::vector<eIndicator> &ind) - : VectorIntoType(&v, eXInteger, ind) {} -}; - -template <> -class UseType<std::vector<int> > : public VectorUseType -{ -public: - UseType(std::vector<int> &v, std::string const &name = std::string()) - : VectorUseType(&v, eXInteger, name) {} - UseType(std::vector<int> &v, std::vector<eIndicator> const &ind, - std::string const &name = std::string()) - : VectorUseType(&v, eXInteger, ind, name) {} -}; - -// into and use types for char - -template <> -class IntoType<char> : public StandardIntoType -{ -public: - IntoType(char &c) : StandardIntoType(&c, eXChar) {} - IntoType(char &c, eIndicator &ind) - : StandardIntoType(&c, eXChar, ind) {} -}; - -template <> -class UseType<char> : public StandardUseType -{ -public: - UseType(char &c, std::string const &name = std::string()) - : StandardUseType(&c, eXChar, name) {} - UseType(char &c, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&c, eXChar, ind, name) {} -}; - -// into and use types for std::vector<char> - -template <> -class IntoType<std::vector<char> >: public VectorIntoType -{ -public: - IntoType(std::vector<char> &v) : VectorIntoType(&v, eXChar) {} - IntoType(std::vector<char> &v, std::vector<eIndicator> &vind) - : VectorIntoType(&v, eXChar, vind) {} -}; - -template <> -class UseType<std::vector<char> >: public VectorUseType -{ -public: - UseType(std::vector<char> &v, std::string const &name = std::string()) - : VectorUseType(&v, eXChar, name) {} - UseType(std::vector<char> &v, std::vector<eIndicator> const &vind, - std::string const &name = std::string()) - : VectorUseType(&v, eXChar, vind, name) {} -}; - -// into and use types for unsigned long - -template <> -class IntoType<unsigned long> : public StandardIntoType -{ -public: - IntoType(unsigned long &ul) : StandardIntoType(&ul, eXUnsignedLong) {} - IntoType(unsigned long &ul, eIndicator &ind) - : StandardIntoType(&ul, eXUnsignedLong, ind) {} -}; - -template <> -class UseType<unsigned long> : public StandardUseType -{ -public: - UseType(unsigned long &ul, std::string const &name = std::string()) - : StandardUseType(&ul, eXUnsignedLong, name) {} - UseType(unsigned long &ul, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&ul, eXUnsignedLong, ind, name) {} -}; - -template <> -class IntoType<std::vector<unsigned long> > : public VectorIntoType -{ -public: - IntoType(std::vector<unsigned long> &v) - : VectorIntoType(&v, eXUnsignedLong) {} - IntoType(std::vector<unsigned long> &v, std::vector<eIndicator> &vind) - : VectorIntoType(&v, eXUnsignedLong, vind) {} -}; - -template <> -class UseType<std::vector<unsigned long> > : public VectorUseType -{ -public: - UseType(std::vector<unsigned long> &v, - std::string const &name = std::string()) - : VectorUseType(&v, eXUnsignedLong, name) {} - UseType(std::vector<unsigned long> &v, - std::vector<eIndicator> const &ind, - std::string const &name = std::string()) - : VectorUseType(&v, eXUnsignedLong, ind, name) {} -}; - -// into and use types for double - -template <> -class IntoType<double> : public StandardIntoType -{ -public: - IntoType(double &d) : StandardIntoType(&d, eXDouble) {} - IntoType(double &d, eIndicator &ind) - : StandardIntoType(&d, eXDouble, ind) {} -}; - -template <> -class UseType<double> : public StandardUseType -{ -public: - UseType(double &d, std::string const &name = std::string()) - : StandardUseType(&d, eXDouble, name) {} - UseType(double &d, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&d, eXDouble, ind, name) {} -}; - -// into and use types for std::vector<double> - -template <> -class IntoType<std::vector<double> > : public VectorIntoType -{ -public: - IntoType(std::vector<double> &v) - : VectorIntoType(&v, eXDouble) {} - IntoType(std::vector<double> &v, std::vector<eIndicator> &vind) - : VectorIntoType(&v, eXDouble, vind) {} -}; - -template <> -class UseType<std::vector<double> > : public VectorUseType -{ -public: - UseType(std::vector<double> &v, std::string const &name = std::string()) - : VectorUseType(&v, eXDouble, name) {} - UseType(std::vector<double> &v, std::vector<eIndicator> const &ind, - std::string const &name = std::string()) - : VectorUseType(&v, eXDouble, ind, name) {} -}; - - -// into and use types for char* - -template <> -class IntoType<char*> : public StandardIntoType -{ -public: - IntoType(char *str, std::size_t bufSize) - : StandardIntoType(&str_, eXCString), str_(str, bufSize) {} - IntoType(char *str, eIndicator &ind, std::size_t bufSize) - : StandardIntoType(&str_, eXCString, ind), str_(str, bufSize) {} - -private: - CStringDescriptor str_; -}; - -template <> -class UseType<char*> : public StandardUseType -{ -public: - UseType(char *str, std::size_t bufSize, - std::string const &name = std::string()) - : StandardUseType(&str_, eXCString, name), str_(str, bufSize) {} - UseType(char *str, eIndicator &ind, std::size_t bufSize, - std::string const &name = std::string()) - : StandardUseType(&str_, eXCString, ind, name), str_(str, bufSize) {} - -private: - CStringDescriptor str_; -}; - -// into and use types for char arrays (with size known at compile-time) - -template <std::size_t N> -class IntoType<char[N]> : public IntoType<char*> -{ -public: - IntoType(char str[]) : IntoType<char*>(str, N) {} - IntoType(char str[], eIndicator &ind) : IntoType<char*>(str, ind, N) {} -}; - -template <std::size_t N> -class UseType<char[N]> : public UseType<char*> -{ -public: - UseType(char str[], std::string const &name = std::string()) - : UseType<char*>(str, N, name) {} - UseType(char str[], eIndicator &ind, - std::string const &name = std::string()) - : UseType<char*>(str, ind, N, name) {} -}; - -// into and use types for std::string - -template <> -class IntoType<std::string> : public StandardIntoType -{ -public: - IntoType(std::string &s) : StandardIntoType(&s, eXStdString) {} - IntoType(std::string &s, eIndicator &ind) - : StandardIntoType(&s, eXStdString, ind) {} -}; - -template <> -class UseType<std::string> : public StandardUseType -{ -public: - UseType(std::string &s, std::string const &name = std::string()) - : StandardUseType(&s, eXStdString, name) {} - UseType(std::string &s, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&s, eXStdString, ind, name) {} -}; - -// into and use types for std::vector<std::string> - -template <> -class IntoType<std::vector<std::string> > : public VectorIntoType -{ -public: - IntoType(std::vector<std::string>& v) - : VectorIntoType(&v, eXStdString) {} - IntoType(std::vector<std::string>& v, std::vector<eIndicator> &vind) - : VectorIntoType(&v, eXStdString, vind) {} -}; - -template <> -class UseType<std::vector<std::string> > : public VectorUseType -{ -public: - UseType(std::vector<std::string>& v, - std::string const &name = std::string()) - : VectorUseType(&v, eXStdString, name) {} - UseType(std::vector<std::string>& v, std::vector<eIndicator> const &ind, - std::string const &name = std::string()) - : VectorUseType(&v, eXStdString, ind, name) {} -}; - -// into and use types for date and time (struct tm) - -template <> -class IntoType<std::tm> : public StandardIntoType -{ -public: - IntoType(std::tm &t) : StandardIntoType(&t, eXStdTm) {} - IntoType(std::tm &t, eIndicator &ind) - : StandardIntoType(&t, eXStdTm, ind) {} -}; - -template <> -class UseType<std::tm> : public StandardUseType -{ -public: - UseType(std::tm &t, std::string const &name = std::string()) - : StandardUseType(&t, eXStdTm, name) {} - UseType(std::tm &t, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&t, eXStdTm, ind, name) {} -}; - -// into and use types for std::vector<std::tm> - -template <> -class IntoType<std::vector<std::tm> > : public VectorIntoType -{ -public: - IntoType(std::vector<std::tm>& v) : VectorIntoType(&v, eXStdTm) {} - IntoType(std::vector<std::tm>& v, std::vector<eIndicator> &vind) - : VectorIntoType(&v, eXStdTm, vind) {} -}; - -template <> -class UseType<std::vector<std::tm> > : public VectorUseType -{ -public: - UseType(std::vector<std::tm>& v, std::string const &name = std::string()) - : VectorUseType(&v, eXStdTm, name) {} - UseType(std::vector<std::tm>& v, std::vector<eIndicator> const &vind, - std::string const &name = std::string()) - : VectorUseType(&v, eXStdTm, vind, name) {} -}; - -// into and use types for Statement (for nested statements and cursors) - -template <> -class IntoType<Statement> : public StandardIntoType -{ -public: - IntoType(Statement &s) : StandardIntoType(&s, eXStatement) {} - IntoType(Statement &s, eIndicator &ind) - : StandardIntoType(&s, eXStatement, ind) {} -}; - -template <> -class UseType<Statement> : public StandardUseType -{ -public: - UseType(Statement &s, std::string const &name = std::string()) - : StandardUseType(&s, eXStatement, name) {} - UseType(Statement &s, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&s, eXStatement, ind, name) {} -}; - -// Support selecting into a Row for dynamic queries - -template <> -class IntoType<Row> : public IntoTypeBase // bypass the StandardIntoType -{ -public: - IntoType(Row &r) : r_(r) {} - -private: - // special handling for Row - virtual void define(details::StatementImpl &st, int & /* position */) - { - st.setRow(&r_); - - // actual row description is performed - // as part of the statement execute - } - - virtual void preFetch() {} - virtual void postFetch(bool gotData, bool /* calledFromFetch */) - { - r_.resetGetCounter(); - - if (gotData) - { - // this is used only to re-dispatch to derived class, if any - // (the derived class might be generated automatically by - // user conversions) - convertFrom(); - } - } - - virtual void cleanUp() {} - - virtual std::size_t size() const { return 1; } - - virtual void convertFrom() {} - - Row &r_; -}; - - - -// this class is used to ensure correct order of construction -// of IntoType and UseType elements that use TypeConversion (later) - -template <typename T> -struct BaseValueHolder -{ - typename TypeConversion<T>::base_type val_; -}; - -template <typename T> -struct BaseVectorHolder -{ - BaseVectorHolder(std::size_t sz = 0) : vec_(sz) {} - std::vector<typename TypeConversion<T>::base_type> vec_; -}; - - -// Automatically create an IntoType from a TypeConversion - -template <typename T> -class IntoType - : private details::BaseValueHolder<T>, - public IntoType<typename TypeConversion<T>::base_type> -{ -public: - typedef typename TypeConversion<T>::base_type BASE_TYPE; - - IntoType(T &value) - : IntoType<BASE_TYPE>(details::BaseValueHolder<T>::val_), - value_(value) {} - IntoType(T &value, eIndicator &ind) - : IntoType<BASE_TYPE>(details::BaseValueHolder<T>::val_, ind), - value_(value) {} - -private: - void convertFrom() - { - value_ = TypeConversion<T>::from(details::BaseValueHolder<T>::val_); - } - - T &value_; -}; - -// Automatically create a UseType from a TypeConversion - -template <typename T> -class UseType - : private details::BaseValueHolder<T>, - public UseType<typename TypeConversion<T>::base_type> -{ -public: - typedef typename TypeConversion<T>::base_type BASE_TYPE; - - UseType(T &value, std::string const &name = std::string()) - : UseType<BASE_TYPE>(details::BaseValueHolder<T>::val_, name), - value_(value) {} - UseType(T &value, eIndicator &ind, std::string const &name - = std::string()) - : UseType<BASE_TYPE>(details::BaseValueHolder<T>::val_, ind, name), - value_(value) {} - - virtual void* getData() - { - convertFrom(); - return &value_; - } - - void convertFrom() - { - value_ = TypeConversion<T>::from(details::BaseValueHolder<T>::val_); - } - void convertTo() - { - details::BaseValueHolder<T>::val_ = TypeConversion<T>::to(value_); - } - -private: - T &value_; -}; - -// Automatically create a std::vector based IntoType from a TypeConversion - -template <typename T> -class IntoType<std::vector<T> > - : private details::BaseVectorHolder<T>, - public IntoType<std::vector<typename TypeConversion<T>::base_type> > -{ -public: - typedef typename std::vector<typename TypeConversion<T>::base_type> - BASE_TYPE; - - IntoType(std::vector<T> &value) - : details::BaseVectorHolder<T>(value.size()), - IntoType<BASE_TYPE>(details::BaseVectorHolder<T>::vec_), - value_(value) {} - - IntoType(std::vector<T> &value, std::vector<eIndicator> &ind) - : details::BaseVectorHolder<T>(value.size()), - IntoType<BASE_TYPE>(details::BaseVectorHolder<T>::vec_, ind), - value_(value) {} - - virtual std::size_t size() const - { - return details::BaseVectorHolder<T>::vec_.size(); - } - virtual void resize(std::size_t sz) - { - value_.resize(sz); - details::BaseVectorHolder<T>::vec_.resize(sz); - } - -private: - void convertFrom() - { - std::size_t const sz = details::BaseVectorHolder<T>::vec_.size(); - - for (std::size_t i = 0; i != sz; ++i) - { - value_[i] = TypeConversion<T>::from( - details::BaseVectorHolder<T>::vec_[i]); - } - } - - std::vector<T> &value_; -}; - -// Automatically create a std::vector based UseType from a TypeConversion -template <typename T> -class UseType<std::vector<T> > - : private details::BaseVectorHolder<T>, - public UseType<std::vector<typename TypeConversion<T>::base_type> > -{ -public: - typedef typename std::vector<typename TypeConversion<T>::base_type> - BASE_TYPE; - - UseType(std::vector<T> &value) - : details::BaseVectorHolder<T>(value.size()), - UseType<BASE_TYPE>(details::BaseVectorHolder<T>::vec_), - value_(value) {} - - UseType(std::vector<T> &value, std::vector<eIndicator> const &ind, - std::string const &name=std::string()) - : details::BaseVectorHolder<T>(value.size()), - UseType<BASE_TYPE>(details::BaseVectorHolder<T>::vec_, ind, name), - value_(value) {} - -private: - void convertFrom() - { - std::size_t const sz = details::BaseVectorHolder<T>::vec_.size(); - for (std::size_t i = 0; i != sz; ++i) - { - value_[i] = TypeConversion<T>::from( - details::BaseVectorHolder<T>::vec_[i]); - } - } - void convertTo() - { - std::size_t const sz = value_.size(); - for (std::size_t i = 0; i != sz; ++i) - { - details::BaseVectorHolder<T>::vec_[i] - = TypeConversion<T>::to(value_[i]); - } - } - - std::vector<T> &value_; -}; - -} // namespace details - - -class SOCI_DECL Values -{ - friend class details::StatementImpl; - friend class details::IntoType<Values>; - friend class details::UseType<Values>; - -public: - - Values() : row_(NULL), currentPos_(0) {} - - eIndicator indicator(std::size_t pos) const; - eIndicator indicator(std::string const &name) const; - - template <typename T> - T get(std::size_t pos) const - { - if (row_) - { - return row_->get<T>(pos); - } - else if (*indicators_[pos] != eNull) - { - return getFromUses<T>(pos); - } - else - { - std::ostringstream msg; - msg << "Column at position " - << static_cast<unsigned long>(pos) - << " contains NULL value and no default was provided"; - throw SOCIError(msg.str()); - } - } - - template <typename T> - T get(std::size_t pos, T const &nullValue) const - { - if (row_) - { - return row_->get<T>(pos, nullValue); - } - else if (*indicators_[pos] == eNull) - { - return nullValue; - } - else - { - return getFromUses<T>(pos); - } - } - - template <typename T> - T get(std::string const &name) const - { - return row_ ? row_->get<T>(name) : getFromUses<T>(name); - } - - template <typename T> - T get(std::string const &name, T const &nullValue) const - { - return row_ ? row_->get<T>(name, nullValue) - : getFromUses<T>(name, nullValue); - } - - template <typename T> - Values const & operator>>(T &value) const - { - value = row_->get<T>(currentPos_); - ++currentPos_; - return *this; - } - - template <typename T> - void set(std::string const &name, T &value, eIndicator indicator=eOK) - { - index_.insert(std::make_pair(name, uses_.size())); - eIndicator* ind = new eIndicator(indicator); - - uses_.push_back(new details::UseType<T>(value, *ind, name)); - indicators_.push_back(ind); - } - -private: - - //TODO To make Values generally usable outside of TypeConversionS, - // these should be reference counted smart pointers - Row *row_; - std::vector<details::StandardUseType*> uses_; - std::map<details::UseTypeBase*, eIndicator*> unused_; - std::vector<eIndicator*> indicators_; - std::map<std::string, size_t> index_; - - // When TypeConversion::to() is called, a Values object is created - // without an underlying Row object. In that case, getFromUses() - // returns the underlying field values - template <typename T> - T getFromUses(std::string const &name, T const &nullValue) const - { - std::map<std::string, size_t>::const_iterator pos = index_.find(name); - if (pos != index_.end()) - { - if (*indicators_[pos->second] == eNull) - { - return nullValue; - } - - try - { - return getFromUses<T>(pos->second); - } - catch(SOCIError const &) - { - throw SOCIError("Value named " + name + " was set using" - " a different type than the one passed to get()"); - } - } - throw SOCIError("Value named " + name + " not found."); - } - - template <typename T> - T getFromUses(std::string const &name) const - { - std::map<std::string, size_t>::const_iterator pos = index_.find(name); - if (pos != index_.end()) - { - if (*indicators_[pos->second] == eNull) - { - throw SOCIError("Column " + name + " contains NULL value and" - " no default was provided"); - } - - try - { - return getFromUses<T>(pos->second); - } - catch(SOCIError const &) - { - throw SOCIError("Value named " + name + " was set using" - " a different type than the one passed to get()"); - } - } - throw SOCIError("Value named " + name + " not found."); - } - - template <typename T> - T getFromUses(size_t pos) const - { - details::StandardUseType* u = uses_[pos]; - if (dynamic_cast<details::UseType<T>* >(u)) - { - return *static_cast<T*>(u->getData()); - } - else - { - std::ostringstream msg; - msg << "Value at position " - << static_cast<unsigned long>(pos) - << " was set using a different type" - " than the one passed to get()"; - throw SOCIError(msg.str()); - } - } - - Row& getRow() - { - row_ = new Row(); - return *row_; - } - - // this is called by Statement::bind(Values) - void addUnused(details::UseTypeBase *u, eIndicator *i) - { - static_cast<details::StandardUseType*>(u)->convertTo(); - unused_.insert(std::make_pair(u, i)); - } - - // this is called by details::IntoType<Values>::cleanUp() - // and UseType<Values>::cleanUp() - void cleanUp() - { - delete row_; - row_ = NULL; - - // delete any uses and indicators which were created by set() but - // were not bound by the Statement - // (bound uses and indicators are deleted in Statement::cleanUp()) - for (std::map<details::UseTypeBase*, eIndicator*>::iterator pos = - unused_.begin(); pos != unused_.end(); ++pos) - { - delete pos->first; - delete pos->second; - } - } - - mutable std::size_t currentPos_; -}; - -namespace details -{ - -template <> -class IntoType<Values> : public IntoType<Row> -{ -public: - IntoType(Values &v) : - IntoType<Row>(v.getRow()), v_(v) {} - - void cleanUp() - { - v_.cleanUp(); - } - -private: - Values &v_; -}; - -template <> -class UseType<Values> : public UseTypeBase -{ -public: - UseType(Values &v, std::string const & /* name */ = std::string()) - : v_(v) {} - - virtual void bind(details::StatementImpl &st, int& /*position*/) - { - convertTo(); - st.bind(v_); - } - - virtual void postUse(bool /*gotData*/) - { - convertFrom(); - } - - virtual void preUse() {} - virtual void cleanUp() {v_.cleanUp();} - virtual std::size_t size() const { return 1; } - - // these are used only to re-dispatch to derived class - // (the derived class might be generated automatically by - // user conversions) - virtual void convertTo() {} - virtual void convertFrom() {} - -private: - Values& v_; -}; - -} // namespace details - -// basic BLOB operations - -class SOCI_DECL BLOB -{ -public: - BLOB(Session &s); - ~BLOB(); - - std::size_t getLen(); - std::size_t read(std::size_t offset, char *buf, std::size_t toRead); - std::size_t write(std::size_t offset, char const *buf, - std::size_t toWrite); - std::size_t append(char const *buf, std::size_t toWrite); - void trim(std::size_t newLen); - - details::BLOBBackEnd * getBackEnd() { return backEnd_; } - -private: - details::BLOBBackEnd *backEnd_; -}; - -namespace details -{ - -template <> -class IntoType<BLOB> : public StandardIntoType -{ -public: - IntoType(BLOB &b) : StandardIntoType(&b, eXBLOB) {} - IntoType(BLOB &b, eIndicator &ind) - : StandardIntoType(&b, eXBLOB, ind) {} -}; - -template <> -class UseType<BLOB> : public StandardUseType -{ -public: - UseType(BLOB &b, std::string const &name = std::string()) - : StandardUseType(&b, eXBLOB, name) {} - UseType(BLOB &b, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&b, eXBLOB, ind, name) {} -}; - -} // namespace details - - -// ROWID support - -class SOCI_DECL RowID -{ -public: - RowID(Session &s); - ~RowID(); - - details::RowIDBackEnd * getBackEnd() { return backEnd_; } - -private: - details::RowIDBackEnd *backEnd_; -}; - -namespace details -{ - -template <> -class IntoType<RowID> : public StandardIntoType -{ -public: - IntoType(RowID &rid) : StandardIntoType(&rid, eXRowID) {} - IntoType(RowID &rid, eIndicator &ind) - :StandardIntoType(&rid, eXRowID, ind) {} -}; - -template <> -class UseType<RowID> : public StandardUseType -{ -public: - UseType(RowID &rid, std::string const &name = std::string()) - : StandardUseType(&rid, eXRowID, name) {} - UseType(RowID &rid, eIndicator &ind, - std::string const &name = std::string()) - : StandardUseType(&rid, eXRowID, ind, name) {} -}; - - -} // namespace details - - -// -// Rowset iterator of input category. -// -template <typename T> -class rowset_iterator -{ -public: - - // Standard iterator traits - - typedef std::input_iterator_tag iterator_category; - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef ptrdiff_t difference_type; - - // Constructors - - rowset_iterator() - : st_(0), define_(0) - {} - - rowset_iterator(Statement& st, T& define) - : st_(&st), define_(&define) - { - assert(0 != st_); - assert(0 != define_); - assert(0 != st_->getBackEnd()); - - // Fetch first row to properly initialize iterator - ++(*this); - } - - // Access operators - - reference operator*() const - { - return (*define_); - } - - pointer operator->() const - { - return &(operator*()); - } - - // Iteration operators - - rowset_iterator& operator++() - { - // Fetch next row from dataset - - if (!st_->fetch()) - { - // Set iterator to non-derefencable state (pass-the-end) - st_ = 0; - define_ = 0; - } - - return (*this); - } - - rowset_iterator operator++(int) - { - rowset_iterator tmp(*this); - ++(*this); - return tmp; - } - - // Comparison operators - - bool operator==(rowset_iterator const& rhs) const - { - return (st_== rhs.st_ && define_ == rhs.define_); - } - - bool operator!=(rowset_iterator const& rhs) const - { - return (!(*this == rhs)); - } - -private: - - // TODO - mloskot: think about weak_ptr here, an observer concept - Statement* st_; - T* define_; - -}; // class rowset_iterator - - -namespace details -{ - -// -// Implementation of Rowset -// -template <typename T> -class RowsetImpl -{ -public: - - typedef rowset_iterator<T> iterator; - - RowsetImpl(details::PrepareTempType const& prep) - : refs_(1), st_(new Statement(prep)), define_(new T()) - { - assert(0 != st_.get()); - assert(0 != define_.get()); - - st_->exchangeForRowset(into(*define_)); - st_->execute(); - } - - void incRef() - { - ++refs_; - } - - void decRef() - { - if (--refs_ == 0) - { - delete this; - } - } - - iterator begin() const - { - // No ownership transfer occurs here - return iterator(*st_, *define_); - } - - iterator end() const - { - return iterator(); - } - -private: - - unsigned int refs_; - - const std::auto_ptr<Statement> st_; - const std::auto_ptr<T> define_; - - // Non-copyable - RowsetImpl(RowsetImpl const&); - RowsetImpl& operator=(RowsetImpl const&); - -}; // class RowsetImpl - -} // namespace details - - -// -// Rowset is a thin wrapper on Statement and provides access to STL-like input iterator. -// The rowset_iterator can be used to easily loop through Statement results and -// use STL algorithms accepting input iterators. -// -template <typename T = SOCI::Row> -class Rowset -{ -public: - - typedef T value_type; - typedef rowset_iterator<T> iterator; - typedef rowset_iterator<T> const_iterator; - - Rowset(details::PrepareTempType const& prep) - : pimpl_(new details::RowsetImpl<T>(prep)) - { - assert(0 != pimpl_); - } - - Rowset(Rowset const& other) - : pimpl_(other.pimpl_) - { - assert(0 != pimpl_); - - pimpl_->incRef(); - } - - ~Rowset() - { - assert(0 != pimpl_); - - pimpl_->decRef(); - } - - Rowset& operator=(Rowset const& rhs) - { - assert(0 != pimpl_); - assert(0 != rhs.pimpl_); - - rhs.incRef(); - pimpl_->decRef(); - pimpl_= rhs.pimpl_; - } - - const_iterator begin() const - { - assert(0 != pimpl_); - - return pimpl_->begin(); - } - - const_iterator end() const - { - assert(0 != pimpl_); - - return pimpl_->end(); - } - -private: - - // Pointer to implementation - the body - details::RowsetImpl<T>* pimpl_; - -}; // class Rowset - - -} // namespace SOCI +#include "backend-loader.h" +#include "blob.h" +#include "blob-exchange.h" +#include "connection-pool.h" +#include "error.h" +#include "exchange-traits.h" +#include "into.h" +#include "into-type.h" +#include "once-temp-type.h" +#include "prepare-temp-type.h" +#include "procedure.h" +#include "ref-counted-prepare-info.h" +#include "ref-counted-statement.h" +#include "row.h" +#include "row-exchange.h" +#include "rowid.h" +#include "rowid-exchange.h" +#include "rowset.h" +#include "session.h" +#include "soci-backend.h" +#include "soci-config.h" +#include "soci-platform.h" +#include "statement.h" +#include "transaction.h" +#include "type-conversion.h" +#include "type-conversion-traits.h" +#include "type-holder.h" +#include "type-ptr.h" +#include "use.h" +#include "use-type.h" +#include "values.h" +#include "values-exchange.h" + +#ifdef SOCI_USE_BOOST +#include <boost/version.hpp> +#if defined(BOOST_VERSION) && BOOST_VERSION >= 103500 +#include "boost-fusion.h" +#endif // BOOST_VERSION +#include "boost-optional.h" +#include "boost-tuple.h" +#include "boost-gregorian-date.h" +#endif // SOCI_USE_BOOST #endif // SOCI_H_INCLUDED - diff --git a/src/core/statement.cpp b/src/core/statement.cpp new file mode 100644 index 00000000..437f4f24 --- /dev/null +++ b/src/core/statement.cpp @@ -0,0 +1,715 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "statement.h" +#include "session.h" +#include "into-type.h" +#include "use-type.h" +#include "values.h" +#include <ctime> + +#ifdef _MSC_VER +#pragma warning(disable:4355) +#endif + +using namespace soci; +using namespace soci::details; + +void statement::exchange(into_type_ptr const & i) +{ + impl_->exchange(i); +} + +void statement::exchange(use_type_ptr const & u) +{ + impl_->exchange(u); +} + +statement_impl::statement_impl(session & s) + : session_(s), refCount_(1), row_(0), + fetchSize_(1), initialFetchSize_(1), + alreadyDescribed_(false) +{ + backEnd_ = s.make_statement_backend(); +} + +statement_impl::statement_impl(prepare_temp_type const & prep) + : session_(prep.get_prepare_info()->session_), + refCount_(1), row_(0), fetchSize_(1), alreadyDescribed_(false) +{ + backEnd_ = session_.make_statement_backend(); + + ref_counted_prepare_info * prepInfo = prep.get_prepare_info(); + + // take all bind/define info + intos_.swap(prepInfo->intos_); + uses_.swap(prepInfo->uses_); + + // allocate handle + alloc(); + + // prepare the statement + query_ = prepInfo->get_query(); + prepare(query_); + + define_and_bind(); +} + +statement_impl::~statement_impl() +{ + clean_up(); +} + +void statement_impl::alloc() +{ + backEnd_->alloc(); +} + +void statement_impl::bind(values & values) +{ + std::size_t cnt = 0; + + try + { + for (std::vector<details::standard_use_type *>::iterator it = + values.uses_.begin(); it != values.uses_.end(); ++it) + { + // only bind those variables which are: + // - either named and actually referenced in the statement, + // - or positional + + std::string const & useName = (*it)->get_name(); + if (useName.empty()) + { + // positional use element + + int position = static_cast<int>(uses_.size()); + (*it)->bind(*this, position); + uses_.push_back(*it); + indicators_.push_back(values.indicators_[cnt]); + } + else + { + // named use element - check if it is used + const std::string placeholder = ":" + useName; + + std::size_t pos = query_.find(placeholder); + if (pos != std::string::npos) + { + const char nextChar = query_[pos + placeholder.size()]; + if (nextChar == ' ' || nextChar == ',' || + nextChar == '\0' || nextChar == ')') + { + int position = static_cast<int>(uses_.size()); + (*it)->bind(*this, position); + uses_.push_back(*it); + indicators_.push_back(values.indicators_[cnt]); + } + else + { + values.add_unused(*it, values.indicators_[cnt]); + } + } + else + { + values.add_unused(*it, values.indicators_[cnt]); + } + } + + cnt++; + } + } + catch (...) + { + for (std::size_t i = ++cnt; i != values.uses_.size(); ++i) + { + values.add_unused(values.uses_[i], values.indicators_[i]); + } + throw; + } +} + +void statement_impl::exchange(into_type_ptr const & i) +{ + intos_.push_back(i.get()); + i.release(); +} + +void statement_impl::exchange_for_row(into_type_ptr const & i) +{ + intosForRow_.push_back(i.get()); + i.release(); +} + +void statement_impl::exchange_for_rowset(into_type_ptr const & i) +{ + if (intos_.empty() == false) + { + throw soci_error("Explicit into elements not allowed with rowset."); + } + + into_type_base * p = i.get(); + intos_.push_back(p); + i.release(); + + int definePosition = 1; + p->define(*this, definePosition); + definePositionForRow_ = definePosition; +} + +void statement_impl::exchange(use_type_ptr const & u) +{ + uses_.push_back(u.get()); + u.release(); +} + +void statement_impl::clean_up() +{ + // deallocate all bind and define objects + std::size_t const isize = intos_.size(); + for (std::size_t i = isize; i != 0; --i) + { + intos_[i - 1]->clean_up(); + delete intos_[i - 1]; + intos_.resize(i - 1); + } + + std::size_t const ifrsize = intosForRow_.size(); + for (std::size_t i = ifrsize; i != 0; --i) + { + intosForRow_[i - 1]->clean_up(); + delete intosForRow_[i - 1]; + intosForRow_.resize(i - 1); + } + + std::size_t const usize = uses_.size(); + for (std::size_t i = usize; i != 0; --i) + { + uses_[i - 1]->clean_up(); + delete uses_[i - 1]; + uses_.resize(i - 1); + } + + std::size_t const indsize = indicators_.size(); + for (std::size_t i = 0; i != indsize; ++i) + { + delete indicators_[i]; + indicators_[i] = NULL; + } + + if (backEnd_ != NULL) + { + backEnd_->clean_up(); + delete backEnd_; + backEnd_ = NULL; + } +} + +void statement_impl::prepare(std::string const & query, + statement_type eType) +{ + query_ = query; + session_.log_query(query); + + backEnd_->prepare(query, eType); +} + +void statement_impl::define_and_bind() +{ + int definePosition = 1; + std::size_t const isize = intos_.size(); + for (std::size_t i = 0; i != isize; ++i) + { + intos_[i]->define(*this, definePosition); + } + + // if there are some implicite into elements + // injected by the row description process, + // they should be defined in the later phase, + // starting at the position where the above loop finished + definePositionForRow_ = definePosition; + + int bindPosition = 1; + std::size_t const usize = uses_.size(); + for (std::size_t i = 0; i != usize; ++i) + { + uses_[i]->bind(*this, bindPosition); + } +} + +void statement_impl::define_for_row() +{ + std::size_t const isize = intosForRow_.size(); + for (std::size_t i = 0; i != isize; ++i) + { + intosForRow_[i]->define(*this, definePositionForRow_); + } +} + +void statement_impl::undefine_and_bind() +{ + std::size_t const isize = intos_.size(); + for (std::size_t i = isize; i != 0; --i) + { + intos_[i - 1]->clean_up(); + } + + std::size_t const ifrsize = intosForRow_.size(); + for (std::size_t i = ifrsize; i != 0; --i) + { + intosForRow_[i - 1]->clean_up(); + } + + std::size_t const usize = uses_.size(); + for (std::size_t i = usize; i != 0; --i) + { + uses_[i - 1]->clean_up(); + } +} + +bool statement_impl::execute(bool withDataExchange) +{ + initialFetchSize_ = intos_size(); + + if (intos_.empty() == false && initialFetchSize_ == 0) + { + // this can happen only with into-vectors elements + // and is not allowed when calling execute + throw soci_error("Vectors of size 0 are not allowed."); + } + + fetchSize_ = initialFetchSize_; + + std::size_t bindSize = uses_size(); + + if (bindSize > 1 && fetchSize_ > 1) + { + throw soci_error( + "Bulk insert/update and bulk select not allowed in same query"); + } + + pre_use(); + + // looks like a hack and it is - row description should happen + // *after* the use elements were completely prepared + // and *before* the into elements are touched, so that the row + // description process can inject more into elements for + // implicit data exchange + if (row_ != NULL && alreadyDescribed_ == false) + { + describe(); + define_for_row(); + } + + int num = 0; + if (withDataExchange) + { + num = 1; + + pre_fetch(); + + if (static_cast<int>(fetchSize_) > num) + { + num = static_cast<int>(fetchSize_); + } + if (static_cast<int>(bindSize) > num) + { + num = static_cast<int>(bindSize); + } + } + + statement_backend::exec_fetch_result res = backEnd_->execute(num); + + bool gotData = false; + + if (res == statement_backend::ef_success) + { + // the "success" means that the statement executed correctly + // and for select statement this also means that some rows were read + + if (num > 0) + { + gotData = true; + + // ensure into vectors have correct size + resize_intos(static_cast<std::size_t>(num)); + } + } + else // res == ef_no_data + { + // the "no data" means that the end-of-rowset condition was hit + // but still some rows might have been read (the last bunch of rows) + // it can also mean that the statement did not produce any results + + gotData = fetchSize_ > 1 ? resize_intos() : false; + } + + if (num > 0) + { + post_fetch(gotData, false); + } + + post_use(gotData); + + session_.set_got_data(gotData); + return gotData; +} + +bool statement_impl::fetch() +{ + if (fetchSize_ == 0) + { + truncate_intos(); + session_.set_got_data(false); + return false; + } + + bool gotData = false; + + // vectors might have been resized between fetches + std::size_t newFetchSize = intos_size(); + if (newFetchSize > initialFetchSize_) + { + // this is not allowed, because most likely caused reallocation + // of the vector - this would require complete re-bind + + throw soci_error( + "Increasing the size of the output vector is not supported."); + } + else if (newFetchSize == 0) + { + session_.set_got_data(false); + return false; + } + else + { + // the output vector was downsized or remains the same as before + fetchSize_ = newFetchSize; + } + + statement_backend::exec_fetch_result res = + backEnd_->fetch(static_cast<int>(fetchSize_)); + if (res == statement_backend::ef_success) + { + // the "success" means that some number of rows was read + // and that it is not yet the end-of-rowset (there are more rows) + + gotData = true; + + // ensure into vectors have correct size + resize_intos(fetchSize_); + } + else // res == ef_no_data + { + // end-of-rowset condition + + if (fetchSize_ > 1) + { + // but still the last bunch of rows might have been read + gotData = resize_intos(); + fetchSize_ = 0; + } + else + { + truncate_intos(); + gotData = false; + } + } + + post_fetch(gotData, true); + session_.set_got_data(gotData); + return gotData; +} + +std::size_t statement_impl::intos_size() +{ + // this function does not need to take into account intosForRow_ elements, + // since their sizes are always 1 (which is the same and the primary + // into(row) element, which has injected them) + + std::size_t intos_size = 0; + std::size_t const isize = intos_.size(); + for (std::size_t i = 0; i != isize; ++i) + { + if (i==0) + { + intos_size = intos_[i]->size(); + } + else if (intos_size != intos_[i]->size()) + { + std::ostringstream msg; + msg << "Bind variable size mismatch (into[" + << static_cast<unsigned long>(i) << "] has size " + << static_cast<unsigned long>(intos_[i]->size()) + << ", into[0] has size " + << static_cast<unsigned long>(intos_size); + throw soci_error(msg.str()); + } + } + return intos_size; +} + +std::size_t statement_impl::uses_size() +{ + std::size_t usesSize = 0; + std::size_t const usize = uses_.size(); + for (std::size_t i = 0; i != usize; ++i) + { + if (i==0) + { + usesSize = uses_[i]->size(); + if (usesSize == 0) + { + // this can happen only for vectors + throw soci_error("Vectors of size 0 are not allowed."); + } + } + else if (usesSize != uses_[i]->size()) + { + std::ostringstream msg; + msg << "Bind variable size mismatch (use[" + << static_cast<unsigned long>(i) << "] has size " + << static_cast<unsigned long>(uses_[i]->size()) + << ", use[0] has size " + << static_cast<unsigned long>(usesSize); + throw soci_error(msg.str()); + } + } + return usesSize; +} + +bool statement_impl::resize_intos(std::size_t upperBound) +{ + // this function does not need to take into account the intosForRow_ + // elements, since they are never used for bulk operations + + std::size_t rows = backEnd_->get_number_of_rows(); + if (upperBound != 0 && upperBound < rows) + { + rows = upperBound; + } + + std::size_t const isize = intos_.size(); + for (std::size_t i = 0; i != isize; ++i) + { + intos_[i]->resize(rows); + } + + return rows > 0 ? true : false; +} + +void statement_impl::truncate_intos() +{ + std::size_t const isize = intos_.size(); + for (std::size_t i = 0; i != isize; ++i) + { + intos_[i]->resize(0); + } +} + +void statement_impl::pre_fetch() +{ + std::size_t const isize = intos_.size(); + for (std::size_t i = 0; i != isize; ++i) + { + intos_[i]->pre_fetch(); + } + + std::size_t const ifrsize = intosForRow_.size(); + for (std::size_t i = 0; i != ifrsize; ++i) + { + intosForRow_[i]->pre_fetch(); + } +} + +void statement_impl::pre_use() +{ + std::size_t const usize = uses_.size(); + for (std::size_t i = 0; i != usize; ++i) + { + uses_[i]->pre_use(); + } +} + +void statement_impl::post_fetch(bool gotData, bool calledFromFetch) +{ + // first iterate over intosForRow_ elements, since the Row element + // (which is among the intos_ elements) might depend on the + // values of those implicitly injected elements + + std::size_t const ifrsize = intosForRow_.size(); + for (std::size_t i = 0; i != ifrsize; ++i) + { + intosForRow_[i]->post_fetch(gotData, calledFromFetch); + } + + std::size_t const isize = intos_.size(); + for (std::size_t i = 0; i != isize; ++i) + { + intos_[i]->post_fetch(gotData, calledFromFetch); + } +} + +void statement_impl::post_use(bool gotData) +{ + // iterate in reverse order here in case the first item + // is an UseType<Values> (since it depends on the other UseTypes) + for (std::size_t i = uses_.size(); i != 0; --i) + { + uses_[i-1]->post_use(gotData); + } +} + +namespace soci +{ +namespace details +{ + +// Map data_types to stock types for dynamic result set support + +template<> +void statement_impl::bind_into<dt_string>() +{ + into_row<std::string>(); +} + +template<> +void statement_impl::bind_into<dt_double>() +{ + into_row<double>(); +} + +template<> +void statement_impl::bind_into<dt_integer>() +{ + into_row<int>(); +} + +template<> +void statement_impl::bind_into<dt_unsigned_long>() +{ + into_row<unsigned long>(); +} + +template<> +void statement_impl::bind_into<dt_long_long>() +{ + into_row<long long>(); +} + +template<> +void statement_impl::bind_into<dt_date>() +{ + into_row<std::tm>(); +} + +void statement_impl::describe() +{ + row_->clean_up(); + + int numcols = backEnd_->prepare_for_describe(); + + for (int i = 1; i <= numcols; ++i) + { + data_type dtype; + std::string columnName; + + backEnd_->describe_column(i, dtype, columnName); + + column_properties props; + props.set_name(columnName); + + props.set_data_type(dtype); + switch (dtype) + { + case dt_string: + bind_into<dt_string>(); + break; + case dt_double: + bind_into<dt_double>(); + break; + case dt_integer: + bind_into<dt_integer>(); + break; + case dt_unsigned_long: + bind_into<dt_unsigned_long>(); + break; + case dt_long_long: + bind_into<dt_long_long>(); + break; + case dt_date: + bind_into<dt_date>(); + break; + default: + std::ostringstream msg; + msg << "db column type " << dtype + <<" not supported for dynamic selects"<<std::endl; + throw soci_error(msg.str()); + } + row_->add_properties(props); + } + + alreadyDescribed_ = true; +} + +} // namespace details +} // namespace soci + +void statement_impl::set_row(row * r) +{ + if (row_ != NULL) + { + throw soci_error( + "Only one Row element allowed in a single statement."); + } + + row_ = r; + row_->uppercase_column_names(session_.get_uppercase_column_names()); +} + +std::string statement_impl::rewrite_for_procedure_call(std::string const & query) +{ + return backEnd_->rewrite_for_procedure_call(query); +} + +void statement_impl::inc_ref() +{ + ++refCount_; +} + +void statement_impl::dec_ref() +{ + if (--refCount_ == 0) + { + delete this; + } +} + +standard_into_type_backend * +statement_impl::make_into_type_backend() +{ + return backEnd_->make_into_type_backend(); +} + +standard_use_type_backend * +statement_impl::make_use_type_backend() +{ + return backEnd_->make_use_type_backend(); +} + +vector_into_type_backend * +statement_impl::make_vector_into_type_backend() +{ + return backEnd_->make_vector_into_type_backend(); +} + +vector_use_type_backend * +statement_impl::make_vector_use_type_backend() +{ + return backEnd_->make_vector_use_type_backend(); +} diff --git a/src/core/statement.h b/src/core/statement.h new file mode 100644 index 00000000..d0b327ba --- /dev/null +++ b/src/core/statement.h @@ -0,0 +1,261 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_STATEMENT_H_INCLUDED +#define SOCI_STATEMENT_H_INCLUDED + +#include "into-type.h" +#include "into.h" +#include "use-type.h" +#include "soci-backend.h" +#include "row.h" + +#include <string> + +namespace soci +{ + +class session; +class values; + +namespace details +{ + +class into_type_base; +class use_type_base; +class prepare_temp_type; + +class SOCI_DECL statement_impl +{ +public: + explicit statement_impl(session & s); + explicit statement_impl(prepare_temp_type const & prep); + ~statement_impl(); + + void alloc(); + void bind(values & v); + void exchange(into_type_ptr const & i); + void exchange(use_type_ptr const & u); + void clean_up(); + + void prepare(std::string const & query, + statement_type eType = st_repeatable_query); + void define_and_bind(); + void undefine_and_bind(); + bool execute(bool withDataExchange = false); + bool fetch(); + void describe(); + void set_row(row * r); + void exchange_for_rowset(into_type_ptr const & i); + + // for diagnostics and advanced users + // (downcast it to expected back-end statement class) + statement_backend * get_backend() { return backEnd_; } + + standard_into_type_backend * make_into_type_backend(); + standard_use_type_backend * make_use_type_backend(); + vector_into_type_backend * make_vector_into_type_backend(); + vector_use_type_backend * make_vector_use_type_backend(); + + void inc_ref(); + void dec_ref(); + + session & session_; + + std::string rewrite_for_procedure_call(std::string const & query); + +protected: + std::vector<details::into_type_base *> intos_; + std::vector<details::use_type_base *> uses_; + std::vector<indicator *> indicators_; + +private: + + int refCount_; + + row * row_; + std::size_t fetchSize_; + std::size_t initialFetchSize_; + std::string query_; + std::map<std::string, use_type_base *> namedUses_; + + std::vector<into_type_base *> intosForRow_; + int definePositionForRow_; + + void exchange_for_row(into_type_ptr const & i); + void define_for_row(); + + template<typename T> + void into_row() + { + T * t = new T(); + indicator * ind = new indicator(i_ok); + row_->add_holder(t, ind); + exchange_for_row(into(*t, *ind)); + } + + template<data_type> void bind_into(); + + bool alreadyDescribed_; + + std::size_t intos_size(); + std::size_t uses_size(); + void pre_fetch(); + void pre_use(); + void post_fetch(bool gotData, bool calledFromFetch); + void post_use(bool gotData); + bool resize_intos(std::size_t upperBound = 0); + void truncate_intos(); + + soci::details::statement_backend * backEnd_; + + // The type is noncopyable. + statement_impl(statement_impl const &); + statement_impl& operator=(statement_impl const &); + +}; + +} // namespace details + +// Statement is a handle class for statement_impl +// (this provides copyability to otherwise non-copyable type) +class SOCI_DECL statement +{ +public: + statement(session & s) + : impl_(new details::statement_impl(s)) {} + statement(details::prepare_temp_type const & prep) + : impl_(new details::statement_impl(prep)) {} + ~statement() { impl_->dec_ref(); } + + // copy is supported for this handle class + statement(statement const & other) + : impl_(other.impl_) + { + impl_->inc_ref(); + } + + void operator=(statement const & other) + { + other.impl_->inc_ref(); + impl_->dec_ref(); + impl_ = other.impl_; + } + + void alloc() { impl_->alloc(); } + void bind(values & v) { impl_->bind(v); } + void exchange(details::into_type_ptr const & i); + void exchange(details::use_type_ptr const & u); + void clean_up() { impl_->clean_up(); } + + void prepare(std::string const & query, + details::statement_type eType = details::st_repeatable_query) + { + impl_->prepare(query, eType); + } + + void define_and_bind() { impl_->define_and_bind(); } + void undefine_and_bind() { impl_->undefine_and_bind(); } + bool execute(bool withDataExchange = false) + { + gotData_ = impl_->execute(withDataExchange); + return gotData_; + } + + bool fetch() + { + gotData_ = impl_->fetch(); + return gotData_; + } + + bool got_data() const { return gotData_; } + + void describe() { impl_->describe(); } + void set_row(row * r) { impl_->set_row(r); } + void exchange_for_rowset(details::into_type_ptr const & i) + { + impl_->exchange_for_rowset(i); + } + + // for diagnostics and advanced users + // (downcast it to expected back-end statement class) + details::statement_backend * get_backend() + { + return impl_->get_backend(); + } + + details::standard_into_type_backend * make_into_type_backend() + { + return impl_->make_into_type_backend(); + } + + details::standard_use_type_backend * make_use_type_backend() + { + return impl_->make_use_type_backend(); + } + + details::vector_into_type_backend * make_vector_into_type_backend() + { + return impl_->make_vector_into_type_backend(); + } + + details::vector_use_type_backend * make_vector_use_type_backend() + { + return impl_->make_vector_use_type_backend(); + } + + std::string rewrite_for_procedure_call(std::string const & query) + { + return impl_->rewrite_for_procedure_call(query); + } + +private: + details::statement_impl * impl_; + bool gotData_; +}; + +namespace details +{ +// exchange_traits for statement + +template <> +struct exchange_traits<statement> +{ + typedef basic_type_tag type_family; + enum { x_type = x_statement }; +}; + +// into and use types for Statement (for nested statements and cursors) + +template <> +class into_type<statement> : public standard_into_type +{ +public: + into_type(statement & s) : standard_into_type(&s, x_statement) {} + into_type(statement & s, indicator & ind) + : standard_into_type(&s, x_statement, ind) {} +}; + +template <> +class use_type<statement> : public standard_use_type +{ +public: + use_type(statement & s, std::string const & name = std::string()) + : standard_use_type(&s, x_statement, false, name) {} + use_type(statement & s, indicator & ind, + std::string const & name = std::string()) + : standard_use_type(&s, x_statement, ind, false, name) {} + + // Note: there is no const version of use for statement, + // because most likely it would not make much sense anyway. +}; + +} // namespace details + +} // namespace SOCI + +#endif // SOCI_STATEMENT_H_INCLUDED diff --git a/src/core/test/Makefile.am b/src/core/test/Makefile.am deleted file mode 100644 index 0b000c9f..00000000 --- a/src/core/test/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -# $Id: Makefile.am,v 1.1 2006/11/09 20:02:11 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# - -socidir = $(includedir)/soci - -noinst_HEADERS = \ - common-tests.h - -MAINTAINERCLEANLOCAL = Makefile.in - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) diff --git a/src/core/test/Makefile.in b/src/core/test/Makefile.in deleted file mode 100644 index 15c97947..00000000 --- a/src/core/test/Makefile.in +++ /dev/null @@ -1,414 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# $Id: Makefile.am,v 1.1 2006/11/09 20:02:11 mloskot Exp $ -# -# Copyright (C) 2006, Mateusz Loskot -# -# Author: Mateusz Loskot <mateusz@loskot.net> -# - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/core/test -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_toolset.m4 \ - $(top_srcdir)/m4/ax_firebird.m4 $(top_srcdir)/m4/ax_mysql.m4 \ - $(top_srcdir)/m4/ax_oracle_oci.m4 \ - $(top_srcdir)/m4/ax_postgresql.m4 \ - $(top_srcdir)/m4/ax_sqlite3.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -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@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMPTY_DIRS = @EMPTY_DIRS@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@ -FIREBIRD_DIRS = @FIREBIRD_DIRS@ -FIREBIRD_LDFLAGS = @FIREBIRD_LDFLAGS@ -FIREBIRD_VERSION = @FIREBIRD_VERSION@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_RELEASE = @LIBTOOL_RELEASE@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_DIRS = @MYSQL_DIRS@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -OBJEXT = @OBJEXT@ -ODBC_DIRS = @ODBC_DIRS@ -ORACLE_DIRS = @ORACLE_DIRS@ -ORACLE_OCI_CFLAGS = @ORACLE_OCI_CFLAGS@ -ORACLE_OCI_LDFLAGS = @ORACLE_OCI_LDFLAGS@ -ORACLE_OCI_VERSION = @ORACLE_OCI_VERSION@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PG_CONFIG = @PG_CONFIG@ -POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@ -POSTGRESQL_DIRS = @POSTGRESQL_DIRS@ -POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@ -POSTGRESQL_VERSION = @POSTGRESQL_VERSION@ -RANLIB = @RANLIB@ -RELEASE_MAJOR = @RELEASE_MAJOR@ -RELEASE_MICRO = @RELEASE_MICRO@ -RELEASE_MINOR = @RELEASE_MINOR@ -RELEASE_VERSION = @RELEASE_VERSION@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CORE_LIBRARY_NAME = @SOCI_CORE_LIBRARY_NAME@ -SOCI_EMPTY_LIBRARY_NAME = @SOCI_EMPTY_LIBRARY_NAME@ -SOCI_FIREBIRD_LIBRARY_NAME = @SOCI_FIREBIRD_LIBRARY_NAME@ -SOCI_MYSQL_LIBRARY_NAME = @SOCI_MYSQL_LIBRARY_NAME@ -SOCI_ODBC_LIBRARY_NAME = @SOCI_ODBC_LIBRARY_NAME@ -SOCI_ORACLE_LIBRARY_NAME = @SOCI_ORACLE_LIBRARY_NAME@ -SOCI_POSTGRESQL_LIBRARY_NAME = @SOCI_POSTGRESQL_LIBRARY_NAME@ -SOCI_SQLITE3_LIBRARY_NAME = @SOCI_SQLITE3_LIBRARY_NAME@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_DIRS = @SQLITE3_DIRS@ -SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ -SQLITE3_VERSION = @SQLITE3_VERSION@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_aux_dir = @ac_aux_dir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -socidir = $(includedir)/soci -noinst_HEADERS = \ - common-tests.h - -MAINTAINERCLEANLOCAL = Makefile.in -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/core/test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/core/test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -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: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool ctags 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-exec install-exec-am install-info \ - install-info-am install-man 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 uninstall uninstall-am uninstall-info-am - - -maintainer-clean-local: - -test -z "$(MAINTAINERCLEANLOCAL)" || rm -rf $(MAINTAINERCLEANLOCAL) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/core/test/common-tests.h b/src/core/test/common-tests.h index eb69cf39..46d7ef24 100644 --- a/src/core/test/common-tests.h +++ b/src/core/test/common-tests.h @@ -1,16 +1,25 @@ // -// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef COMMON_TESTS_H_INCLUDED -#define COMMON_TESTS_H_INCLUDED +#ifndef SOCI_COMMON_TESTS_H_INCLUDED +#define SOCI_COMMON_TESTS_H_INCLUDED #include "soci.h" #include "soci-config.h" +// explicitly pull conversions for Boost's optional, tuple and fusion: +#include <boost/version.hpp> +#include <boost-optional.h> +#include <boost-tuple.h> +#include <boost-gregorian-date.h> +#if defined(BOOST_VERSION) && BOOST_VERSION >= 103500 +#include <boost-fusion.h> +#endif // BOOST_VERSION + #include <algorithm> #include <cmath> #include <iostream> @@ -23,204 +32,277 @@ struct PhonebookEntry std::string phone; }; -struct PhonebookEntry2 : public PhonebookEntry +struct PhonebookEntry2 : public PhonebookEntry +{ +}; + +class PhonebookEntry3 +{ +public: + void setName(std::string const & n) { name_ = n; } + std::string getName() const { return name_; } + + void setPhone(std::string const & p) { phone_ = p; } + std::string getPhone() const { return phone_; } + +public: + std::string name_; + std::string phone_; +}; + +// user-defined object for test26 and test28 +class MyInt { +public: + MyInt() {} + MyInt(int i) : i_(i) {} + void set(int i) { i_ = i; } + int get() const { return i_; } +private: + int i_; }; -namespace SOCI +namespace soci { -// basic type conversion -template<> struct TypeConversion<PhonebookEntry> + +// basic type conversion for user-defined type with single base value +template<> struct type_conversion<MyInt> { - typedef SOCI::Values base_type; - static PhonebookEntry from(Values const &v) + typedef int base_type; + + static void from_base(int i, indicator ind, MyInt &mi) { - PhonebookEntry p; - p.name = v.get<std::string>("name"); - p.phone = v.get<std::string>("phone", "<NULL>"); - return p; + if (ind == i_ok) + { + mi.set(i); + } } - static Values to(PhonebookEntry &p) + + static void to_base(MyInt const &mi, int &i, indicator &ind) { - Values v; - v.set("name", p.name); - v.set("phone", p.phone, p.phone.empty() ? eNull : eOK); - return v; + i = mi.get(); + ind = i_ok; } -}; +}; -// type conversion which directly calls Values::indicator() -template<> struct TypeConversion<PhonebookEntry2> +// basic type conversion on many values (ORM) +template<> struct type_conversion<PhonebookEntry> { - typedef SOCI::Values base_type; - static PhonebookEntry2 from(Values const &v) + typedef soci::values base_type; + + static void from_base(values const &v, indicator /* ind */, PhonebookEntry &pe) { - PhonebookEntry2 p; - p.name = v.get<std::string>("name"); - eIndicator ind = v.indicator("phone"); //another way to test for null - p.phone = ind == eNull ? "<NULL>" : v.get<std::string>("phone"); - return p; + // here we ignore the possibility the the whole object might be NULL + pe.name = v.get<std::string>("NAME"); + pe.phone = v.get<std::string>("PHONE", "<NULL>"); } - static Values to(PhonebookEntry2 &p) + + static void to_base(PhonebookEntry const &pe, values &v, indicator &ind) { - Values v; - v.set("name", p.name); - v.set("phone", p.phone, p.phone.empty() ? eNull : eOK); - return v; + v.set("NAME", pe.name); + v.set("PHONE", pe.phone, pe.phone.empty() ? i_null : i_ok); + ind = i_ok; } -}; +}; -} +// type conversion which directly calls values::get_indicator() +template<> struct type_conversion<PhonebookEntry2> +{ + typedef soci::values base_type; + + static void from_base(values const &v, indicator /* ind */, PhonebookEntry2 &pe) + { + // here we ignore the possibility the the whole object might be NULL + + pe.name = v.get<std::string>("NAME"); + indicator ind = v.get_indicator("PHONE"); //another way to test for null + pe.phone = ind == i_null ? "<NULL>" : v.get<std::string>("PHONE"); + } + + static void to_base(PhonebookEntry2 const &pe, values &v, indicator &ind) + { + v.set("NAME", pe.name); + v.set("PHONE", pe.phone, pe.phone.empty() ? i_null : i_ok); + ind = i_ok; + } +}; -namespace SOCI +template<> struct type_conversion<PhonebookEntry3> +{ + typedef soci::values base_type; + + static void from_base(values const &v, indicator /* ind */, PhonebookEntry3 &pe) + { + // here we ignore the possibility the the whole object might be NULL + + pe.setName(v.get<std::string>("NAME")); + pe.setPhone(v.get<std::string>("PHONE", "<NULL>")); + } + + static void to_base(PhonebookEntry3 const &pe, values &v, indicator &ind) + { + v.set("NAME", pe.getName()); + v.set("PHONE", pe.getPhone(), pe.getPhone().empty() ? i_null : i_ok); + ind = i_ok; + } +}; + +} // namespace soci + +namespace soci { namespace tests { -class TableCreatorBase +class table_creator_base { public: - TableCreatorBase(Session& session) - : mSession(session) { drop(); } + table_creator_base(session& sql) + : msession(sql) { drop(); } - virtual ~TableCreatorBase() { drop();} + virtual ~table_creator_base() { drop();} private: void drop() { - try { mSession << "drop table soci_test"; } catch(SOCIError&) {} + try { msession << "drop table soci_test"; } catch (soci_error&) {} } - Session& mSession; + session& msession; }; -class ProcedureCreatorBase +class procedure_creator_base { public: - ProcedureCreatorBase(Session& session) - : mSession(session) { drop(); } + procedure_creator_base(session& sql) + : msession(sql) { drop(); } - virtual ~ProcedureCreatorBase() { drop();} + virtual ~procedure_creator_base() { drop();} private: void drop() { - try { mSession << "drop procedure soci_test"; } catch(SOCIError&) {} + try { msession << "drop procedure soci_test"; } catch (soci_error&) {} } - Session& mSession; + session& msession; }; -class FunctionCreatorBase +class function_creator_base { public: - FunctionCreatorBase(Session& session) - : mSession(session) { drop(); } + function_creator_base(session& sql) + : msession(sql) { drop(); } - virtual ~FunctionCreatorBase() { drop();} + virtual ~function_creator_base() { drop();} protected: - virtual std::string dropStatement() - { + virtual std::string dropstatement() + { return "drop function soci_test"; } private: void drop() { - try { mSession << dropStatement(); } catch(SOCIError&) {} + try { msession << dropstatement(); } catch (soci_error&) {} } - Session& mSession; + session& msession; }; -class TestContextBase +class test_context_base { public: - TestContextBase(BackEndFactory const &backEnd, + test_context_base(backend_factory const &backEnd, std::string const &connectString) : backEndFactory_(backEnd), connectString_(connectString) {} - const BackEndFactory& getBackEndFactory() const + backend_factory const & getbackend_factory() const { return backEndFactory_; } - std::string getConnectString() const + std::string get_connect_string() const { return connectString_; } - virtual std::string toDateTime(std::string const &dateTime) const = 0; + virtual std::string to_date_time(std::string const &dateTime) const = 0; - virtual TableCreatorBase* tableCreator1(Session&) const = 0; - virtual TableCreatorBase* tableCreator2(Session&) const = 0; - virtual TableCreatorBase* tableCreator3(Session&) const = 0; + virtual table_creator_base* table_creator_1(session&) const = 0; + virtual table_creator_base* table_creator_2(session&) const = 0; + virtual table_creator_base* table_creator_3(session&) const = 0; - virtual ~TestContextBase() {} // quiet the compiler + virtual ~test_context_base() {} // quiet the compiler private: - BackEndFactory const &backEndFactory_; + backend_factory const &backEndFactory_; std::string const connectString_; }; -class CommonTests +class common_tests { public: - CommonTests(TestContextBase const &tc) - : tc_(tc), - backEndFactory_(tc.getBackEndFactory()), - connectString_(tc.getConnectString()) + common_tests(test_context_base const &tc) + : tc_(tc), + backEndFactory_(tc.getbackend_factory()), + connectString_(tc.get_connect_string()) {} void run(bool dbSupportsTransactions = true) { - std::cout<<"\nSOCI Common Tests:\n\n"; - - test1(); - test2(); - test3(); - test4(); - test5(); - test6(); - test7(); - test8(); - test9(); - - if (dbSupportsTransactions) - { - test10(); - } - else - { - std::cout<<"skipping test 10 (database doesn't support transactions)\n"; - } + std::cout<<"\nSOCI Common Tests:\n\n"; + + test1(); + test2(); + test3(); + test4(); + test5(); + test6(); + test7(); + test8(); + test9(); + + if (dbSupportsTransactions) + { + test10(); + } + else + { + std::cout<<"skipping test 10 (database doesn't support transactions)\n"; + } - test11(); - test12(); - test13(); - test14(); - test15(); - test16(); - test17(); - test18(); - test19(); - test20(); - test21(); - test22(); - test23(); - test24(); - test25(); + test11(); + test12(); + test13(); + test14(); + test15(); + test16(); + test17(); + test18(); + test19(); + test20(); + test21(); + test22(); + test23(); + test24(); + test25(); + test26(); + test27(); + test28(); + test29(); + test30(); } private: - TestContextBase const & tc_; - BackEndFactory const &backEndFactory_; + test_context_base const & tc_; + backend_factory const &backEndFactory_; std::string const connectString_; -typedef std::auto_ptr<TableCreatorBase> AutoTableCreator; +typedef std::auto_ptr<table_creator_base> auto_table_creator; void test1() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::string msg; try @@ -229,11 +311,11 @@ void test1() sql << "drop table soci_test_nosuchtable"; assert(false); } - catch (SOCIError const &e) + catch (soci_error const &e) { msg = e.what(); } - assert(!msg.empty()); + assert(msg.empty() == false); sql << "insert into soci_test (id) values (" << 123 << ")"; int id; @@ -247,10 +329,10 @@ void test1() void test2() { { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); char c('a'); sql << "insert into soci_test(c) values(:c)", use(c); @@ -259,7 +341,7 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::string abc("ABC"); sql << "insert into soci_test(str) values(:s)", use(abc); @@ -273,7 +355,7 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::string hello("Hello"); sql << "insert into soci_test(str) values(:s)", use(hello); @@ -287,8 +369,8 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); - + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + std::string helloSOCI("Hello, SOCI!"); sql << "insert into soci_test(str) values(:s)", use(helloSOCI); std::string str; @@ -297,7 +379,7 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); short three(3); sql << "insert into soci_test(sh) values(:id)", use(three); @@ -307,8 +389,8 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); - + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + int five(5); sql << "insert into soci_test(id) values(:id)", use(five); int i(0); @@ -317,7 +399,7 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); unsigned long seven(7); sql << "insert into soci_test(ul) values(:ul)", use(seven); unsigned long ul(0); @@ -326,8 +408,8 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); - + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + double pi(3.14159265); sql << "insert into soci_test(d) values(:d)", use(pi); double d(0.0); @@ -336,7 +418,7 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::tm nov15; nov15.tm_year = 105; @@ -345,7 +427,7 @@ void test2() nov15.tm_hour = 0; nov15.tm_min = 0; nov15.tm_sec = 0; - + sql << "insert into soci_test(tm) values(:tm)", use(nov15); std::tm t; @@ -359,7 +441,7 @@ void test2() } { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::tm nov15; nov15.tm_year = 105; @@ -383,37 +465,37 @@ void test2() // test indicators { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int id(1); std::string str("Hello"); sql << "insert into soci_test(id, str) values(:id, :str)", - use(id), use(str); + use(id), use(str); int i; - eIndicator ind; + indicator ind; sql << "select id from soci_test", into(i, ind); - assert(ind == eOK); + assert(ind == i_ok); char buf[4]; sql << "select str from soci_test", into(buf, ind); - assert(ind == eTruncated); + assert(ind == i_truncated); } // more indicator tests, NULL values { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); sql << "insert into soci_test(id,tm) values(NULL,NULL)"; int i; - eIndicator ind; + indicator ind; sql << "select id from soci_test", into(i, ind); - assert(ind == eNull); + assert(ind == i_null); // additional test for NULL with std::tm std::tm t; sql << "select tm from soci_test", into(t, ind); - assert(ind == eNull); + assert(ind == i_null); try { @@ -421,7 +503,7 @@ void test2() sql << "select id from soci_test", into(i); assert(false); } - catch (SOCIError const &e) + catch (soci_error const &e) { std::string error = e.what(); assert(error == @@ -429,20 +511,16 @@ void test2() } sql << "select id from soci_test where id = 1000", into(i, ind); - assert(ind == eNoData); + assert(sql.got_data() == false); - try - { - // expect error - sql << "select id from soci_test where id = 1000", into(i); - assert(false); - } - catch (SOCIError const &e) - { - std::string error = e.what(); - assert(error == - "No data fetched and no indicator defined."); - } + // no data expected + sql << "select id from soci_test where id = 1000", into(i); + assert(sql.got_data() == false); + + // no data expected, test correct behaviour with use + int id = 1000; + sql << "select id from soci_test where id = :id", use(id), into(i); + assert(sql.got_data() == false); } } @@ -453,12 +531,12 @@ void test2() void test3() { { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // repeated fetch and bulk fetch of char { // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); char c; for (c = 'a'; c <= 'z'; ++c) @@ -473,7 +551,7 @@ void test3() { char c2 = 'a'; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select c from soci_test order by c", into(c)); st.execute(); @@ -488,7 +566,7 @@ void test3() char c2 = 'a'; std::vector<char> vec(10); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select c from soci_test order by c", into(vec)); st.execute(); while (st.fetch()) @@ -512,7 +590,7 @@ void test3() sql << "select c from soci_test", into(vec); assert(false); } - catch (SOCIError const &e) + catch (soci_error const &e) { std::string msg = e.what(); assert(msg == "Vectors of size 0 are not allowed."); @@ -524,7 +602,7 @@ void test3() // repeated fetch and bulk fetch of std::string { // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const rowsToTest = 10; for (int i = 0; i != rowsToTest; ++i) @@ -543,7 +621,7 @@ void test3() { int i = 0; std::string s; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select str from soci_test order by str", into(s)); st.execute(); @@ -560,7 +638,7 @@ void test3() int i = 0; std::vector<std::string> vec(4); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select str from soci_test order by str", into(vec)); st.execute(); while (st.fetch()) @@ -582,7 +660,7 @@ void test3() // repeated fetch and bulk fetch of short { // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); short const rowsToTest = 100; short sh; @@ -598,7 +676,7 @@ void test3() { short sh2 = 0; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select sh from soci_test order by sh", into(sh)); st.execute(); @@ -613,7 +691,7 @@ void test3() short sh2 = 0; std::vector<short> vec(8); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select sh from soci_test order by sh", into(vec)); st.execute(); while (st.fetch()) @@ -633,7 +711,7 @@ void test3() // repeated fetch and bulk fetch of int { // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const rowsToTest = 100; int i; @@ -649,7 +727,7 @@ void test3() { int i2 = 0; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select id from soci_test order by id", into(i)); st.execute(); @@ -666,7 +744,7 @@ void test3() int i2 = 0; int cond = 0; // this condition is always true - Statement st = (sql.prepare << + statement st = (sql.prepare << "select id from soci_test where id >= :cond order by id", use(cond), into(i)); @@ -682,7 +760,7 @@ void test3() int i2 = 0; std::vector<int> vec(8); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select id from soci_test order by id", into(vec)); st.execute(); while (st.fetch()) @@ -702,7 +780,7 @@ void test3() // repeated fetch and bulk fetch of unsigned long { // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); unsigned long const rowsToTest = 100; unsigned long ul; @@ -718,7 +796,7 @@ void test3() { unsigned long ul2 = 0; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select ul from soci_test order by ul", into(ul)); st.execute(); @@ -733,7 +811,7 @@ void test3() unsigned long ul2 = 0; std::vector<unsigned long> vec(8); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select ul from soci_test order by ul", into(vec)); st.execute(); while (st.fetch()) @@ -753,7 +831,7 @@ void test3() // repeated fetch and bulk fetch of double { // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const rowsToTest = 100; double d = 0.0; @@ -771,7 +849,7 @@ void test3() double d2 = 0.0; int i = 0; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select d from soci_test order by d", into(d)); st.execute(); @@ -788,7 +866,7 @@ void test3() int i = 0; std::vector<double> vec(8); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select d from soci_test order by d", into(vec)); st.execute(); while (st.fetch()) @@ -809,7 +887,7 @@ void test3() // repeated fetch and bulk fetch of std::tm { // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const rowsToTest = 8; for (int i = 0; i != rowsToTest; ++i) @@ -819,7 +897,7 @@ void test3() << 15 + i << ':' << 50 - i << ':' << 40 + i; sql << "insert into soci_test(id, tm) values(" << i - << ", " << tc_.toDateTime(ss.str()) << ")"; + << ", " << tc_.to_date_time(ss.str()) << ")"; } int count; @@ -830,7 +908,7 @@ void test3() std::tm t; int i = 0; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select tm from soci_test order by id", into(t)); st.execute(); @@ -851,7 +929,7 @@ void test3() int i = 0; std::vector<std::tm> vec(3); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select tm from soci_test order by id", into(vec)); st.execute(); while (st.fetch()) @@ -877,14 +955,14 @@ void test3() std::cout << "test 3 passed" << std::endl; } - + // test for indicators (repeated fetch and bulk) void test4() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 11)"; @@ -894,60 +972,99 @@ void test4() { int val; - eIndicator ind; + indicator ind; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select val from soci_test order by id", into(val, ind)); st.execute(); - assert(st.fetch()); - assert(ind == eOK); + bool gotData = st.fetch(); + assert(gotData); + assert(ind == i_ok); assert(val == 10); - assert(st.fetch()); - assert(ind == eOK); + gotData = st.fetch(); + assert(gotData); + assert(ind == i_ok); assert(val == 11); - assert(st.fetch()); - assert(ind == eNull); - assert(st.fetch()); - assert(ind == eNull); - assert(st.fetch()); - assert(ind == eOK); + gotData = st.fetch(); + assert(gotData); + assert(ind == i_null); + gotData = st.fetch(); + assert(gotData); + assert(ind == i_null); + gotData = st.fetch(); + assert(gotData); + assert(ind == i_ok); assert(val == 12); - assert(!st.fetch()); + gotData = st.fetch(); + assert(gotData == false); } { std::vector<int> vals(3); - std::vector<eIndicator> inds(3); + std::vector<indicator> inds(3); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select val from soci_test order by id", into(vals, inds)); st.execute(); - assert(st.fetch()); + bool gotData = st.fetch(); + assert(gotData); assert(vals.size() == 3); assert(inds.size() == 3); - assert(inds[0] == eOK); + assert(inds[0] == i_ok); assert(vals[0] == 10); - assert(inds[1] == eOK); + assert(inds[1] == i_ok); assert(vals[1] == 11); - assert(inds[2] == eNull); - assert(st.fetch()); + assert(inds[2] == i_null); + gotData = st.fetch(); + assert(gotData); assert(vals.size() == 2); - assert(inds[0] == eNull); - assert(inds[1] == eOK); + assert(inds[0] == i_null); + assert(inds[1] == i_ok); assert(vals[1] == 12); - assert(!st.fetch()); + gotData = st.fetch(); + assert(gotData == false); } // additional test for "no data" condition { std::vector<int> vals(3); - std::vector<eIndicator> inds(3); + std::vector<indicator> inds(3); - Statement st = (sql.prepare << + statement st = (sql.prepare << "select val from soci_test where 0 = 1", into(vals, inds)); - assert(!st.execute(true)); + bool gotData = st.execute(true); + assert(gotData == false); + + // for convenience, vectors should be truncated + assert(vals.empty()); + assert(inds.empty()); + + // for even more convenience, fetch should not fail + // but just report end of rowset + // (and vectors should be truncated) + + vals.resize(1); + inds.resize(1); + + gotData = st.fetch(); + assert(gotData == false); + assert(vals.empty()); + assert(inds.empty()); + } + + // additional test for "no data" without prepared statement + { + std::vector<int> vals(3); + std::vector<indicator> inds(3); + + sql << "select val from soci_test where 0 = 1", + into(vals, inds); + + // vectors should be truncated + assert(vals.empty()); + assert(inds.empty()); } } @@ -958,10 +1075,10 @@ void test4() // (library should force ind. vector to have same size as data vector) void test5() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 11)"; @@ -971,9 +1088,9 @@ void test5() { std::vector<int> vals(4); - std::vector<eIndicator> inds; + std::vector<indicator> inds; - Statement st = (sql.prepare << + statement st = (sql.prepare << "select val from soci_test order by id", into(vals, inds)); st.execute(); @@ -996,11 +1113,11 @@ void test6() // Note: this functionality is not available with older PostgreSQL #ifndef SOCI_PGSQL_NOPARAMS { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // test for char { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); char c('a'); sql << "insert into soci_test(c) values(:c)", use(c); @@ -1012,7 +1129,7 @@ void test6() // test for char[] { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); char s[] = "Hello"; sql << "insert into soci_test(str) values(:s)", use(s); @@ -1025,7 +1142,7 @@ void test6() // test for std::string { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::string s = "Hello SOCI!"; sql << "insert into soci_test(str) values(:s)", use(s); @@ -1037,7 +1154,7 @@ void test6() // test for short { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); short s = 123; sql << "insert into soci_test(id) values(:id)", use(s); @@ -1049,7 +1166,7 @@ void test6() // test for int { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int i = -12345678; sql << "insert into soci_test(id) values(:i)", use(i); @@ -1061,7 +1178,7 @@ void test6() // test for unsigned long { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); unsigned long ul = 4000000000ul; sql << "insert into soci_test(ul) values(:num)", use(ul); @@ -1073,7 +1190,7 @@ void test6() // test for double { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); double d = 3.14159265; sql << "insert into soci_test(d) values(:d)", use(d); @@ -1085,7 +1202,7 @@ void test6() // test for std::tm { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::tm t; t.tm_year = 105; t.tm_mon = 10; @@ -1115,9 +1232,9 @@ void test6() // test for repeated use { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int i; - Statement st = (sql.prepare + statement st = (sql.prepare << "insert into soci_test(id) values(:id)", use(i)); i = 5; @@ -1136,6 +1253,123 @@ void test6() assert(v[2] == 7); } + // tests for use of const objects + + // test for char + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + char const c('a'); + sql << "insert into soci_test(c) values(:c)", use(c); + + char c2 = 'b'; + sql << "select c from soci_test", into(c2); + assert(c2 == 'a'); + + } + + // test for char[] + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + + char const s[] = "Hello const!"; + sql << "insert into soci_test(str) values(:s)", use(s); + + std::string str; + sql << "select str from soci_test", into(str); + + assert(str == "Hello const!"); + } + + // test for std::string + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + std::string const s = "Hello const SOCI!"; + sql << "insert into soci_test(str) values(:s)", use(s); + + std::string str; + sql << "select str from soci_test", into(str); + + assert(str == "Hello const SOCI!"); + } + + // test for short + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + short const s = 123; + sql << "insert into soci_test(id) values(:id)", use(s); + + short s2 = 0; + sql << "select id from soci_test", into(s2); + + assert(s2 == 123); + } + + // test for int + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + int const i = -12345678; + sql << "insert into soci_test(id) values(:i)", use(i); + + int i2 = 0; + sql << "select id from soci_test", into(i2); + + assert(i2 == -12345678); + } + + // test for unsigned long + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + unsigned long const ul = 4000000000ul; + sql << "insert into soci_test(ul) values(:num)", use(ul); + + unsigned long ul2 = 0; + sql << "select ul from soci_test", into(ul2); + + assert(ul2 == 4000000000ul); + } + + // test for double + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + double const d = 3.14159265; + sql << "insert into soci_test(d) values(:d)", use(d); + + double d2 = 0; + sql << "select d from soci_test", into(d2); + + assert(std::fabs(d2 - d) < 0.0001); + } + + // test for std::tm + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + std::tm t; + t.tm_year = 105; + t.tm_mon = 10; + t.tm_mday = 19; + t.tm_hour = 21; + t.tm_min = 39; + t.tm_sec = 57; + std::tm const & ct = t; + sql << "insert into soci_test(tm) values(:t)", use(ct); + + std::tm t2; + t2.tm_year = 0; + t2.tm_mon = 0; + t2.tm_mday = 0; + t2.tm_hour = 0; + t2.tm_min = 0; + t2.tm_sec = 0; + + sql << "select tm from soci_test", into(t2); + + assert(t.tm_year == 105); + assert(t.tm_mon == 10); + assert(t.tm_mday == 19); + assert(t.tm_hour == 21); + assert(t.tm_min == 39); + assert(t.tm_sec == 57); + } } std::cout << "test 6 passed" << std::endl; @@ -1146,8 +1380,8 @@ void test6() void test7() { { - Session sql(backEndFactory_, connectString_); - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + session sql(backEndFactory_, connectString_); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { int i1 = 5; @@ -1185,7 +1419,7 @@ void test7() #ifndef SOCI_PGSQL_NOPARAMS - Statement st = (sql.prepare + statement st = (sql.prepare << "insert into soci_test(i1, i2, i3) values(:i1, :i2, :i3)", use(i1), use(i2), use(i3)); @@ -1243,11 +1477,11 @@ void test8() #ifndef SOCI_PGSQL_NOPARAMS { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // test for char { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<char> v; v.push_back('a'); @@ -1269,7 +1503,7 @@ void test8() // test for std::string { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<std::string> v; v.push_back("ala"); @@ -1289,7 +1523,7 @@ void test8() // test for short { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<short> v; v.push_back(-5); @@ -1311,7 +1545,7 @@ void test8() // test for int { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<int> v; v.push_back(-2000000000); @@ -1333,7 +1567,7 @@ void test8() // test for unsigned long { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<unsigned long> v; v.push_back(0); @@ -1353,9 +1587,9 @@ void test8() assert(v2[3] == 1000); } - // test for char + // test for double { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<double> v; v.push_back(0); @@ -1377,7 +1611,7 @@ void test8() // test for std::tm { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<std::tm> v; std::tm t; @@ -1421,6 +1655,30 @@ void test8() assert(v2[2].tm_min == 45); assert(v2[2].tm_sec == 37); } + + // additional test for int (use const vector) + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + + std::vector<int> v; + v.push_back(-2000000000); + v.push_back(0); + v.push_back(1); + v.push_back(2000000000); + + std::vector<int> const & cv = v; + + sql << "insert into soci_test(id) values(:i)", use(cv); + + std::vector<int> v2(4); + + sql << "select id from soci_test order by id", into(v2); + assert(v2.size() == 4); + assert(v2[0] == -2000000000); + assert(v2[1] == 0); + assert(v2[2] == 1); + assert(v2[3] == 2000000000); + } } std::cout << "test 8 passed" << std::endl; @@ -1436,9 +1694,9 @@ void test9() #ifndef SOCI_PGSQL_NOPARAMS { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); { - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int i1 = 7; int i2 = 8; @@ -1452,7 +1710,7 @@ void test9() assert(false); } - catch (SOCIError const &e) + catch (soci_error const &e) { assert(std::string(e.what()) == "Binding for use elements must be either by position " @@ -1513,69 +1771,68 @@ void test9() void test10() { { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); int count; sql << "select count(*) from soci_test", into(count); assert(count == 0); { - sql.begin(); - -#ifndef SOCI_PGSQL_NOPARAMS - - int id; - std::string name; - - Statement st1 = (sql.prepare << - "insert into soci_test (id, name) values (:id, :name)", - use(id), use(name)); - - id = 1; name = "John"; st1.execute(true); - id = 2; name = "Anna"; st1.execute(true); - id = 3; name = "Mike"; st1.execute(true); - -#else - // Older PostgreSQL does not support use elements + transaction tr(sql); sql << "insert into soci_test (id, name) values(1, 'John')"; sql << "insert into soci_test (id, name) values(2, 'Anna')"; sql << "insert into soci_test (id, name) values(3, 'Mike')"; -#endif // SOCI_PGSQL_NOPARAMS - - sql.commit(); - sql.begin(); + tr.commit(); + } + { + transaction tr(sql); sql << "select count(*) from soci_test", into(count); assert(count == 3); -#ifndef SOCI_PGSQL_NOPARAMS - id = 4; name = "Stan"; st1.execute(true); -#else sql << "insert into soci_test (id, name) values(4, 'Stan')"; -#endif // SOCI_PGSQL_NOPARAMS sql << "select count(*) from soci_test", into(count); assert(count == 4); - sql.rollback(); + + tr.rollback(); sql << "select count(*) from soci_test", into(count); assert(count == 3); } { - sql.begin(); + transaction tr(sql); sql << "delete from soci_test"; sql << "select count(*) from soci_test", into(count); assert(count == 0); - sql.rollback(); + + tr.rollback(); + sql << "select count(*) from soci_test", into(count); assert(count == 3); } + { + // additional test for detection of double commit + transaction tr(sql); + tr.commit(); + try + { + tr.commit(); + assert(false); + } + catch (soci_error const &e) + { + std::string msg = e.what(); + assert(msg == + "The transaction object cannot be handled twice."); + } + } } std::cout << "test 10 passed" << std::endl; @@ -1586,12 +1843,12 @@ void test11() { #ifndef SOCI_PGSQL_NOPARAMS { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); - eIndicator ind1 = eOK; - eIndicator ind2 = eOK; + indicator ind1 = i_ok; + indicator ind2 = i_ok; int id = 1; int val = 10; @@ -1601,15 +1858,15 @@ void test11() id = 2; val = 11; - ind2 = eNull; + ind2 = i_null; sql << "insert into soci_test(id, val) values(:id, :val)", use(id, ind1), use(val, ind2); sql << "select val from soci_test where id = 1", into(val, ind2); - assert(ind2 == eOK); + assert(ind2 == i_ok); assert(val == 10); sql << "select val from soci_test where id = 2", into(val, ind2); - assert(ind2 == eNull); + assert(ind2 == i_null); std::vector<int> ids; ids.push_back(3); @@ -1619,10 +1876,10 @@ void test11() vals.push_back(12); vals.push_back(13); vals.push_back(14); - std::vector<eIndicator> inds; - inds.push_back(eOK); - inds.push_back(eNull); - inds.push_back(eOK); + std::vector<indicator> inds; + inds.push_back(i_ok); + inds.push_back(i_null); + inds.push_back(i_ok); sql << "insert into soci_test(id, val) values(:id, :val)", use(ids), use(vals, inds); @@ -1639,11 +1896,11 @@ void test11() assert(ids[3] == 2); assert(ids[4] == 1); assert(inds.size() == 5); - assert(inds[0] == eOK); - assert(inds[1] == eNull); - assert(inds[2] == eOK); - assert(inds[3] == eNull); - assert(inds[4] == eOK); + assert(inds[0] == i_ok); + assert(inds[1] == i_null); + assert(inds[2] == i_ok); + assert(inds[3] == i_null); + assert(inds[4] == i_ok); assert(vals.size() == 5); assert(vals[0] == 14); assert(vals[2] == 12); @@ -1659,43 +1916,45 @@ void test11() void test12() { { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); - AutoTableCreator tableCreator(tc_.tableCreator2(sql)); + sql.uppercase_column_names(true); - Row r; + auto_table_creator tableCreator(tc_.table_creator_2(sql)); + + row r; sql << "select * from soci_test", into(r); - assert(r.indicator(0) == eNoData); + assert(sql.got_data() == false); sql << "insert into soci_test" " values(3.14, 123, \'Johny\'," - << tc_.toDateTime("2005-12-19 22:14:17") + << tc_.to_date_time("2005-12-19 22:14:17") << ", 'a')"; - // select into a Row + // select into a row { - Row r; - Statement st = (sql.prepare << + row r; + statement st = (sql.prepare << "select * from soci_test", into(r)); st.execute(true); assert(r.size() == 5); - assert(r.getProperties(0).getDataType() == eDouble); - assert(r.getProperties(1).getDataType() == eInteger); - assert(r.getProperties(2).getDataType() == eString); - assert(r.getProperties(3).getDataType() == eDate); + assert(r.get_properties(0).get_data_type() == dt_double); + assert(r.get_properties(1).get_data_type() == dt_integer); + assert(r.get_properties(2).get_data_type() == dt_string); + assert(r.get_properties(3).get_data_type() == dt_date); // type char is visible as string // - to comply with the implementation for Oracle - assert(r.getProperties(4).getDataType() == eString); + assert(r.get_properties(4).get_data_type() == dt_string); - assert(r.getProperties("num_int").getDataType() == eInteger); + assert(r.get_properties("NUM_INT").get_data_type() == dt_integer); - assert(r.getProperties(0).getName() == "num_float"); - assert(r.getProperties(1).getName() == "num_int"); - assert(r.getProperties(2).getName() == "name"); - assert(r.getProperties(3).getName() == "sometime"); - assert(r.getProperties(4).getName() == "chr"); + assert(r.get_properties(0).get_name() == "NUM_FLOAT"); + assert(r.get_properties(1).get_name() == "NUM_INT"); + assert(r.get_properties(2).get_name() == "NAME"); + assert(r.get_properties(3).get_name() == "SOMETIME"); + assert(r.get_properties(4).get_name() == "CHR"); assert(std::fabs(r.get<double>(0) - 3.14) < 0.001); assert(r.get<int>(1) == 123); @@ -1706,12 +1965,12 @@ void test12() // again, type char is visible as string assert(r.get<std::string>(4) == "a"); - assert(std::fabs(r.get<double>("num_float") - 3.14) < 0.001); - assert(r.get<int>("num_int") == 123); - assert(r.get<std::string>("name") == "Johny"); - assert(r.get<std::string>("chr") == "a"); + assert(std::fabs(r.get<double>("NUM_FLOAT") - 3.14) < 0.001); + assert(r.get<int>("NUM_INT") == 123); + assert(r.get<std::string>("NAME") == "Johny"); + assert(r.get<std::string>("CHR") == "a"); - assert(r.indicator(0) == eOK); + assert(r.get_indicator(0) == i_ok); // verify exception thrown on invalid get<> bool caught = false; @@ -1746,7 +2005,27 @@ void test12() assert(t.tm_sec == 17); assert(c == "a"); } + } + + // additional test to check if the row object can be + // reused between queries + { + row r; + sql << "select * from soci_test", into(r); + + assert(r.size() == 5); + + assert(r.get_properties(0).get_data_type() == dt_double); + assert(r.get_properties(1).get_data_type() == dt_integer); + assert(r.get_properties(2).get_data_type() == dt_string); + assert(r.get_properties(3).get_data_type() == dt_date); + + sql << "select name, num_int from soci_test", into(r); + assert(r.size() == 2); + + assert(r.get_properties(0).get_data_type() == dt_string); + assert(r.get_properties(1).get_data_type() == dt_integer); } } @@ -1756,9 +2035,9 @@ void test12() // more dynamic bindings void test13() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 20)"; @@ -1767,44 +2046,44 @@ void test13() #ifndef SOCI_PGSQL_NOPARAMS { int id = 2; - Row r; + row r; sql << "select val from soci_test where id = :id", use(id), into(r); assert(r.size() == 1); - assert(r.getProperties(0).getDataType() == eInteger); + assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 20); } { int id; - Row r; - Statement st = (sql.prepare << + row r; + statement st = (sql.prepare << "select val from soci_test where id = :id", use(id), into(r)); id = 2; st.execute(true); assert(r.size() == 1); - assert(r.getProperties(0).getDataType() == eInteger); + assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 20); id = 3; st.execute(true); assert(r.size() == 1); - assert(r.getProperties(0).getDataType() == eInteger); + assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 30); id = 1; st.execute(true); assert(r.size() == 1); - assert(r.getProperties(0).getDataType() == eInteger); + assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 10); } #else { - Row r; + row r; sql << "select val from soci_test where id = 2", into(r); assert(r.size() == 1); - assert(r.getProperties(0).getDataType() == eInteger); + assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 20); } #endif // SOCI_PGSQL_NOPARAMS @@ -1812,45 +2091,87 @@ void test13() std::cout << "test 13 passed" << std::endl; } -// More Dynamic binding to Row objects +// More Dynamic binding to row objects void test14() { { - Session sql(backEndFactory_, connectString_); - AutoTableCreator tableCreator(tc_.tableCreator3(sql)); + session sql(backEndFactory_, connectString_); + + sql.uppercase_column_names(true); - Row r1; + auto_table_creator tableCreator(tc_.table_creator_3(sql)); + + row r1; sql << "select * from soci_test", into(r1); - assert(r1.indicator(0) == eNoData); + assert(sql.got_data() == false); sql << "insert into soci_test values('david', '(404)123-4567')"; sql << "insert into soci_test values('john', '(404)123-4567')"; sql << "insert into soci_test values('doe', '(404)123-4567')"; - Row r2; - Statement st = (sql.prepare << "select * from soci_test", into(r2)); + row r2; + statement st = (sql.prepare << "select * from soci_test", into(r2)); st.execute(); - assert(r2.size() == 2); + assert(r2.size() == 2); int count = 0; - while(st.fetch()) + while (st.fetch()) { ++count; - assert(r2.get<std::string>("phone") == "(404)123-4567"); + assert(r2.get<std::string>("PHONE") == "(404)123-4567"); } assert(count == 3); } std::cout << "test 14 passed" << std::endl; } -// test15 is like test14 but with a TypeConversion instead of a row +// test15 is like test14 but with a type_conversion instead of a row void test15() -{ - Session sql(backEndFactory_, connectString_); +{ + session sql(backEndFactory_, connectString_); + + sql.uppercase_column_names(true); + // simple conversion (between single basic type and user type) + + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + + MyInt mi; + mi.set(123); + sql << "insert into soci_test(id) values(:id)", use(mi); + + int i; + sql << "select id from soci_test", into(i); + assert(i == 123); + + sql << "update soci_test set id = id + 1"; + + sql << "select id from soci_test", into(mi); + assert(mi.get() == 124); + } + + // simple conversion with use const + + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + + MyInt mi; + mi.set(123); + + MyInt const & cmi = mi; + sql << "insert into soci_test(id) values(:id)", use(cmi); + + int i; + sql << "select id from soci_test", into(i); + assert(i == 123); + } + + // conversions based on values (many fields involved -> ORM) + { - AutoTableCreator tableCreator(tc_.tableCreator3(sql)); + auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry p1; sql << "select * from soci_test", into(p1); @@ -1859,21 +2180,27 @@ void test15() p1.name = "david"; - sql << "insert into soci_test values(:name, :phone)", use(p1); + // Note: uppercase column names are used here (and later on) + // for consistency with how they can be read from database + // (which means forced to uppercase on Oracle) and how they are + // set/get in the type conversion routines for PhonebookEntry. + // In short, IF the database is Oracle, + // then all column names for binding should be uppercase. + sql << "insert into soci_test values(:NAME, :PHONE)", use(p1); sql << "insert into soci_test values('john', '(404)123-4567')"; sql << "insert into soci_test values('doe', '(404)123-4567')"; PhonebookEntry p2; - Statement st = (sql.prepare << "select * from soci_test", into(p2)); + statement st = (sql.prepare << "select * from soci_test", into(p2)); st.execute(); int count = 0; - while(st.fetch()) + while (st.fetch()) { ++count; if (p2.name == "david") { - // see TypeConversion<PhonebookEntry> + // see type_conversion<PhonebookEntry> assert(p2.phone =="<NULL>"); } else @@ -1881,34 +2208,75 @@ void test15() assert(p2.phone == "(404)123-4567"); } } - assert(count == 3); + assert(count == 3); } - { // Use the PhonebookEntry2 type conversion, to test - // calls to Values::indicator() - AutoTableCreator tableCreator(tc_.tableCreator3(sql)); + // conversions based on values with use const - PhonebookEntry2 p1; - sql << "select * from soci_test", into(p1); + { + auto_table_creator tableCreator(tc_.table_creator_3(sql)); + + PhonebookEntry p1; + p1.name = "Joe Coder"; + p1.phone = "123-456"; + + PhonebookEntry const & cp1 = p1; + + sql << "insert into soci_test values(:NAME, :PHONE)", use(cp1); + + PhonebookEntry p2; + sql << "select * from soci_test", into(p2); + assert(sql.got_data()); + + assert(p2.name == "Joe Coder"); + assert(p2.phone == "123-456"); + } + + // conversions based on accessor functions (as opposed to direct variable bindings) + + { + auto_table_creator tableCreator(tc_.table_creator_3(sql)); + + PhonebookEntry3 p1; + p1.setName("Joe Hacker"); + p1.setPhone("10010110"); + + sql << "insert into soci_test values(:NAME, :PHONE)", use(p1); + + PhonebookEntry3 p2; + sql << "select * from soci_test", into(p2); + assert(sql.got_data()); + + assert(p2.getName() == "Joe Hacker"); + assert(p2.getPhone() == "10010110"); + } + + { + // Use the PhonebookEntry2 type conversion, to test + // calls to values::get_indicator() + auto_table_creator tableCreator(tc_.table_creator_3(sql)); + + PhonebookEntry2 p1; + sql << "select * from soci_test", into(p1); assert(p1.name == ""); assert(p1.phone == ""); p1.name = "david"; - sql << "insert into soci_test values(:name, :phone)", use(p1); + sql << "insert into soci_test values(:NAME, :PHONE)", use(p1); sql << "insert into soci_test values('john', '(404)123-4567')"; sql << "insert into soci_test values('doe', '(404)123-4567')"; PhonebookEntry2 p2; - Statement st = (sql.prepare << "select * from soci_test", into(p2)); + statement st = (sql.prepare << "select * from soci_test", into(p2)); st.execute(); int count = 0; - while(st.fetch()) + while (st.fetch()) { ++count; if (p2.name == "david") { - // see TypeConversion<PhonebookEntry2> + // see type_conversion<PhonebookEntry2> assert(p2.phone =="<NULL>"); } else @@ -1916,7 +2284,7 @@ void test15() assert(p2.phone == "(404)123-4567"); } } - assert(count == 3); + assert(count == 3); } std::cout << "test 15 passed" << std::endl; @@ -1927,9 +2295,9 @@ void test16() { #ifndef SOCI_PGSQL_NOPARAMS { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); sql << "insert into soci_test(name, id) values('john', 1)"; sql << "insert into soci_test(name, id) values('george', 2)"; @@ -1955,10 +2323,10 @@ void test16() // test for basic logging support void test17() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); std::ostringstream log; - sql.setLogStream(&log); + sql.set_log_stream(&log); try { @@ -1966,9 +2334,9 @@ void test17() } catch (...) {} - assert(sql.getLastQuery() == "drop table soci_test1"); + assert(sql.get_last_query() == "drop table soci_test1"); - sql.setLogStream(NULL); + sql.set_log_stream(NULL); try { @@ -1976,9 +2344,9 @@ void test17() } catch (...) {} - assert(sql.getLastQuery() == "drop table soci_test2"); + assert(sql.get_last_query() == "drop table soci_test2"); - sql.setLogStream(&log); + sql.set_log_stream(&log); try { @@ -1986,7 +2354,7 @@ void test17() } catch (...) {} - assert(sql.getLastQuery() == "drop table soci_test3"); + assert(sql.get_last_query() == "drop table soci_test3"); assert(log.str() == "drop table soci_test1\n" "drop table soci_test3\n"); @@ -1994,35 +2362,37 @@ void test17() std::cout << "test 17 passed\n"; } -// test for Rowset creation and copying +// test for rowset creation and copying void test18() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { // Open empty rowset - Rowset<Row> rs1 = (sql.prepare << "select * from soci_test"); + rowset<row> rs1 = (sql.prepare << "select * from soci_test"); + assert(rs1.empty()); - // Copy by assignment - Rowset<Row> rs2 = rs1; - Rowset<Row> rs3(rs2); + // Copy construction + rowset<row> rs2(rs1); + assert(rs2.empty()); - // TODO - mloskot: - // Fix issue with rs1.begin() == rs2.begin() + // Copy by assignment + rowset<row> rs3 = rs1; + assert(rs3.empty()); } std::cout << "test 18 passed" << std::endl; } -// test for simple iterating using Rowset iterator (without reading data) +// test for simple iterating using rowset iterator (without reading data) void test19() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 11)"; @@ -2030,7 +2400,7 @@ void test19() sql << "insert into soci_test(id, val) values(4, NULL)"; sql << "insert into soci_test(id, val) values(5, 12)"; { - Rowset<Row> rs = (sql.prepare << "select * from soci_test"); + rowset<row> rs = (sql.prepare << "select * from soci_test"); assert(5 == std::distance(rs.begin(), rs.end())); } @@ -2039,47 +2409,49 @@ void test19() std::cout << "test 19 passed" << std::endl; } -// test for reading Rowset<Row> using iterator +// test for reading rowset<row> using iterator void test20() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); + + sql.uppercase_column_names(true); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator2(sql)); + auto_table_creator tableCreator(tc_.table_creator_2(sql)); { { // Empty rowset - Rowset<Row> rs = (sql.prepare << "select * from soci_test"); + rowset<row> rs = (sql.prepare << "select * from soci_test"); assert(0 == std::distance(rs.begin(), rs.end())); } { // Non-empty rowset sql << "insert into soci_test values(3.14, 123, \'Johny\'," - << tc_.toDateTime("2005-12-19 22:14:17") + << tc_.to_date_time("2005-12-19 22:14:17") << ", 'a')"; sql << "insert into soci_test values(6.28, 246, \'Robert\'," - << tc_.toDateTime("2004-10-01 18:44:10") + << tc_.to_date_time("2004-10-01 18:44:10") << ", 'b')"; - Rowset<Row> rs = (sql.prepare << "select * from soci_test"); + rowset<row> rs = (sql.prepare << "select * from soci_test"); - Rowset<Row>::const_iterator it = rs.begin(); + rowset<row>::const_iterator it = rs.begin(); assert(it != rs.end()); - + // // First row - // - Row const& r1 = (*it); + // + row const & r1 = (*it); // Properties assert(r1.size() == 5); - assert(r1.getProperties(0).getDataType() == eDouble); - assert(r1.getProperties(1).getDataType() == eInteger); - assert(r1.getProperties(2).getDataType() == eString); - assert(r1.getProperties(3).getDataType() == eDate); - assert(r1.getProperties(4).getDataType() == eString); - assert(r1.getProperties("num_int").getDataType() == eInteger); + assert(r1.get_properties(0).get_data_type() == dt_double); + assert(r1.get_properties(1).get_data_type() == dt_integer); + assert(r1.get_properties(2).get_data_type() == dt_string); + assert(r1.get_properties(3).get_data_type() == dt_date); + assert(r1.get_properties(4).get_data_type() == dt_string); + assert(r1.get_properties("NUM_INT").get_data_type() == dt_integer); // Data @@ -2100,10 +2472,10 @@ void test20() std::tm t1 = r1.get<std::tm>(3); assert(t1.tm_year == 105); assert(r1.get<std::string>(4) == "a"); - assert(std::fabs(r1.get<double>("num_float") - 3.14) < 0.001); - assert(r1.get<int>("num_int") == 123); - assert(r1.get<std::string>("name") == "Johny"); - assert(r1.get<std::string>("chr") == "a"); + assert(std::fabs(r1.get<double>("NUM_FLOAT") - 3.14) < 0.001); + assert(r1.get<int>("NUM_INT") == 123); + assert(r1.get<std::string>("NAME") == "Johny"); + assert(r1.get<std::string>("CHR") == "a"); } else { @@ -2113,13 +2485,13 @@ void test20() std::tm t1 = r1.get<std::tm>(3); assert(t1.tm_year == 104); assert(r1.get<std::string>(4) == "b"); - assert(std::fabs(r1.get<double>("num_float") - 6.28) < 0.001); - assert(r1.get<int>("num_int") == 246); - assert(r1.get<std::string>("name") == "Robert"); - assert(r1.get<std::string>("chr") == "b"); + assert(std::fabs(r1.get<double>("NUM_FLOAT") - 6.28) < 0.001); + assert(r1.get<int>("NUM_INT") == 246); + assert(r1.get<std::string>("NAME") == "Robert"); + assert(r1.get<std::string>("CHR") == "b"); } - // + // // Iterate to second row // ++it; @@ -2128,21 +2500,21 @@ void test20() // // Second row // - Row const& r2 = (*it); + row const & r2 = (*it); // Properties assert(r2.size() == 5); - assert(r2.getProperties(0).getDataType() == eDouble); - assert(r2.getProperties(1).getDataType() == eInteger); - assert(r2.getProperties(2).getDataType() == eString); - assert(r2.getProperties(3).getDataType() == eDate); - assert(r2.getProperties(4).getDataType() == eString); - assert(r2.getProperties("num_int").getDataType() == eInteger); + assert(r2.get_properties(0).get_data_type() == dt_double); + assert(r2.get_properties(1).get_data_type() == dt_integer); + assert(r2.get_properties(2).get_data_type() == dt_string); + assert(r2.get_properties(3).get_data_type() == dt_date); + assert(r2.get_properties(4).get_data_type() == dt_string); + assert(r2.get_properties("NUM_INT").get_data_type() == dt_integer); std::string newName = r2.get<std::string>(2); assert(name != newName); assert(newName == "Johny" || newName == "Robert"); - + if (newName == "Johny") { assert(std::fabs(r2.get<double>(0) - 3.14) < 0.001); @@ -2151,10 +2523,10 @@ void test20() std::tm t2 = r2.get<std::tm>(3); assert(t2.tm_year == 105); assert(r2.get<std::string>(4) == "a"); - assert(std::fabs(r2.get<double>("num_float") - 3.14) < 0.001); - assert(r2.get<int>("num_int") == 123); - assert(r2.get<std::string>("name") == "Johny"); - assert(r2.get<std::string>("chr") == "a"); + assert(std::fabs(r2.get<double>("NUM_FLOAT") - 3.14) < 0.001); + assert(r2.get<int>("NUM_INT") == 123); + assert(r2.get<std::string>("NAME") == "Johny"); + assert(r2.get<std::string>("CHR") == "a"); } else { @@ -2164,10 +2536,10 @@ void test20() std::tm t2 = r2.get<std::tm>(3); assert(t2.tm_year == 104); assert(r2.get<std::string>(4) == "b"); - assert(std::fabs(r2.get<double>("num_float") - 6.28) < 0.001); - assert(r2.get<int>("num_int") == 246); - assert(r2.get<std::string>("name") == "Robert"); - assert(r2.get<std::string>("chr") == "b"); + assert(std::fabs(r2.get<double>("NUM_FLOAT") - 6.28) < 0.001); + assert(r2.get<int>("NUM_INT") == 246); + assert(r2.get<std::string>("NAME") == "Robert"); + assert(r2.get<std::string>("CHR") == "b"); } } } @@ -2175,13 +2547,13 @@ void test20() std::cout << "test 20 passed" << std::endl; } -// test for reading Rowset<int> using iterator +// test for reading rowset<int> using iterator void test21() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(id) values(1)"; sql << "insert into soci_test(id) values(2)"; @@ -2189,10 +2561,10 @@ void test21() sql << "insert into soci_test(id) values(4)"; sql << "insert into soci_test(id) values(5)"; { - Rowset<int> rs = (sql.prepare << "select id from soci_test order by id asc"); + rowset<int> rs = (sql.prepare << "select id from soci_test order by id asc"); // 1st row - Rowset<int>::const_iterator pos = rs.begin(); + rowset<int>::const_iterator pos = rs.begin(); assert(1 == (*pos)); // 3rd row @@ -2206,21 +2578,19 @@ void test21() // The End ++pos; assert(pos == rs.end()); - - // XXX - advancing with negative value throws segfault } } std::cout << "test 21 passed" << std::endl; } -// test for handling 'use' and reading Rowset<std::string> using iterator +// test for handling 'use' and reading rowset<std::string> using iterator void test22() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(str) values('abc')"; sql << "insert into soci_test(str) values('def')"; @@ -2229,7 +2599,7 @@ void test22() { // Expected result in numbers std::string idle("def"); - Rowset<std::string> rs1 = (sql.prepare + rowset<std::string> rs1 = (sql.prepare << "select str from soci_test where str = :idle", use(idle)); @@ -2237,7 +2607,7 @@ void test22() // Expected result in value idle = "jkl"; - Rowset<std::string> rs2 = (sql.prepare + rowset<std::string> rs2 = (sql.prepare << "select str from soci_test where str = :idle", use(idle)); @@ -2251,10 +2621,10 @@ void test22() // test for handling troublemaker void test23() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(str) values('abc')"; { @@ -2263,10 +2633,10 @@ void test23() try { std::string troublemaker; - Rowset<std::string> rs1 = (sql.prepare << "select str from soci_test", + rowset<std::string> rs1 = (sql.prepare << "select str from soci_test", into(troublemaker)); } - catch(SOCIError const& e) + catch (soci_error const&) { caught = true; } @@ -2281,10 +2651,10 @@ void test23() // "Null value fetched and no indicator defined." void test24() { - Session sql(backEndFactory_, connectString_); + session sql(backEndFactory_, connectString_); // create and populate the test table - AutoTableCreator tableCreator(tc_.tableCreator1(sql)); + auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(val) values(1)"; sql << "insert into soci_test(val) values(2)"; @@ -2295,11 +2665,10 @@ void test24() bool caught = false; try { - std::string troublemaker; - Rowset<int> rs = (sql.prepare << "select val from soci_test order by val asc"); + rowset<int> rs = (sql.prepare << "select val from soci_test order by val asc"); int tester = 0; - for (Rowset<int>::const_iterator it = rs.begin(); it != rs.end(); ++it) + for (rowset<int>::const_iterator it = rs.begin(); it != rs.end(); ++it) { tester = *it; } @@ -2307,7 +2676,7 @@ void test24() // Never should get here assert(false); } - catch(SOCIError const& e) + catch (soci_error const&) { caught = true; } @@ -2315,16 +2684,17 @@ void test24() } std::cout << "test 24 passed" << std::endl; } - } -// test25 is like test15 but with Rowset and iterators use +// test25 is like test15 but with rowset and iterators use void test25() -{ - Session sql(backEndFactory_, connectString_); +{ + session sql(backEndFactory_, connectString_); + + sql.uppercase_column_names(true); { - AutoTableCreator tableCreator(tc_.tableCreator3(sql)); + auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry p1; sql << "select * from soci_test", into(p1); @@ -2333,20 +2703,20 @@ void test25() p1.name = "david"; - sql << "insert into soci_test values(:name, :phone)", use(p1); + sql << "insert into soci_test values(:NAME, :PHONE)", use(p1); sql << "insert into soci_test values('john', '(404)123-4567')"; sql << "insert into soci_test values('doe', '(404)123-4567')"; - Rowset<PhonebookEntry> rs = (sql.prepare << "select * from soci_test"); + rowset<PhonebookEntry> rs = (sql.prepare << "select * from soci_test"); int count = 0; - for (Rowset<PhonebookEntry>::const_iterator it = rs.begin(); it != rs.end(); ++it) + for (rowset<PhonebookEntry>::const_iterator it = rs.begin(); it != rs.end(); ++it) { ++count; PhonebookEntry const& p2 = (*it); if (p2.name == "david") { - // see TypeConversion<PhonebookEntry> + // see type_conversion<PhonebookEntry> assert(p2.phone =="<NULL>"); } else @@ -2355,15 +2725,734 @@ void test25() } } - assert(3 == count); + assert(3 == count); } std::cout << "test 25 passed" << std::endl; } -}; // class CommonTests +// test for handling NULL values with boost::optional +// (both into and use) +void test26() +{ + session sql(backEndFactory_, connectString_); + + // create and populate the test table + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + { + sql << "insert into soci_test(val) values(7)"; + + { + // verify non-null value is fetched correctly + boost::optional<int> opt; + sql << "select val from soci_test", into(opt); + assert(opt.is_initialized()); + assert(opt.get() == 7); + + // indicators can be used with optional + // (although that's just a consequence of implementation, + // not an intended feature - but let's test it anyway) + indicator ind; + opt.reset(); + sql << "select val from soci_test", into(opt, ind); + assert(opt.is_initialized()); + assert(opt.get() == 7); + assert(ind == i_ok); + + // verify null value is fetched correctly + sql << "select i1 from soci_test", into(opt); + assert(opt.is_initialized() == false); + + // and with indicator + opt = 5; + sql << "select i1 from soci_test", into(opt, ind); + assert(opt.is_initialized() == false); + assert(ind == i_null); + + // verify non-null is inserted correctly + opt = 3; + sql << "update soci_test set val = :v", use(opt); + int j = 0; + sql << "select val from soci_test", into(j); + assert(j == 3); + + // verify null is inserted correctly + opt.reset(); + sql << "update soci_test set val = :v", use(opt); + ind = i_ok; + sql << "select val from soci_test", into(j, ind); + assert(ind == i_null); + } + + // vector tests (select) + + { + sql << "delete from soci_test"; + + // simple readout of non-null data + + sql << "insert into soci_test(id, val, str) values(1, 5, \'abc\')"; + sql << "insert into soci_test(id, val, str) values(2, 6, \'def\')"; + sql << "insert into soci_test(id, val, str) values(3, 7, \'ghi\')"; + sql << "insert into soci_test(id, val, str) values(4, 8, null)"; + sql << "insert into soci_test(id, val, str) values(5, 9, \'mno\')"; + + std::vector<boost::optional<int> > v(10); + sql << "select val from soci_test order by val", into(v); + + assert(v.size() == 5); + assert(v[0].is_initialized()); + assert(v[0].get() == 5); + assert(v[1].is_initialized()); + assert(v[1].get() == 6); + assert(v[2].is_initialized()); + assert(v[2].get() == 7); + assert(v[3].is_initialized()); + assert(v[3].get() == 8); + assert(v[4].is_initialized()); + assert(v[4].get() == 9); + + // readout of nulls + + sql << "update soci_test set val = null where id = 2 or id = 4"; + + std::vector<int> ids(5); + sql << "select id, val from soci_test order by id", into(ids), into(v); + + assert(v.size() == 5); + assert(ids.size() == 5); + assert(v[0].is_initialized()); + assert(v[0].get() == 5); + assert(v[1].is_initialized() == false); + assert(v[2].is_initialized()); + assert(v[2].get() == 7); + assert(v[3].is_initialized() == false); + assert(v[4].is_initialized()); + assert(v[4].get() == 9); + + // readout with statement preparation + + int id = 1; + + ids.resize(3); + v.resize(3); + statement st = (sql.prepare << + "select id, val from soci_test order by id", into(ids), into(v)); + st.execute(); + while (st.fetch()) + { + for (std::size_t i = 0; i != v.size(); ++i) + { + assert(id == ids[i]); + + if (id == 2 || id == 4) + { + assert(v[i].is_initialized() == false); + } + else + { + assert(v[i].is_initialized() && v[i].get() == id + 4); + } + + ++id; + } + + ids.resize(3); + v.resize(3); + } + assert(id == 6); + } + + // and why not stress iterators and the dynamic binding, too! + + { + rowset<row> rs = (sql.prepare << "select id, val, str from soci_test order by id"); + + rowset<row>::const_iterator it = rs.begin(); + assert(it != rs.end()); + + row const& r1 = (*it); + + assert(r1.size() == 3); + + // Note: for the reason of differences between number(x,y) type and + // binary representation of integers, the following commented assertions + // do not work for Oracle. + // The problem is that for this single table the data type used in Oracle + // table creator for the id column is number(10,0), + // which allows to insert all int values. + // On the other hand, the column description scheme used in the Oracle + // backend figures out that the natural type for such a column + // is eUnsignedInt - this makes the following assertions fail. + // Other database backends (like PostgreSQL) use other types like int + // and this not only allows to insert all int values (obviously), + // but is also recognized as int (obviously). + // There is a similar problem with stream-like extraction, + // where internally get<T> is called and the type mismatch is detected + // for the id column - that's why the code below skips this column + // and tests the remaining column only. + + //assert(r1.get_properties(0).get_data_type() == dt_integer); + assert(r1.get_properties(1).get_data_type() == dt_integer); + assert(r1.get_properties(2).get_data_type() == dt_string); + //assert(r1.get<int>(0) == 1); + assert(r1.get<int>(1) == 5); + assert(r1.get<std::string>(2) == "abc"); + assert(r1.get<boost::optional<int> >(1).is_initialized()); + assert(r1.get<boost::optional<int> >(1).get() == 5); + assert(r1.get<boost::optional<std::string> >(2).is_initialized()); + assert(r1.get<boost::optional<std::string> >(2).get() == "abc"); + + ++it; + + row const& r2 = (*it); + + assert(r2.size() == 3); + + // assert(r2.get_properties(0).get_data_type() == dt_integer); + assert(r2.get_properties(1).get_data_type() == dt_integer); + assert(r2.get_properties(2).get_data_type() == dt_string); + //assert(r2.get<int>(0) == 2); + try + { + // expect exception here, this is NULL value + (void)r1.get<int>(1); + assert(false); + } + catch (soci_error const &) {} + + // but we can read it as optional + assert(r2.get<boost::optional<int> >(1).is_initialized() == false); + + // stream-like data extraction + + ++it; + row const &r3 = (*it); + + boost::optional<int> io; + boost::optional<std::string> so; + + r3.skip(); // move to val and str columns + r3 >> io >> so; + + assert(io.is_initialized() && io.get() == 7); + assert(so.is_initialized() && so.get() == "ghi"); + + ++it; + row const &r4 = (*it); + + r3.skip(); // move to val and str columns + r4 >> io >> so; + + assert(io.is_initialized() == false); + assert(so.is_initialized() == false); + } + + // bulk inserts of non-null data + + { + sql << "delete from soci_test"; + + std::vector<int> ids; + std::vector<boost::optional<int> > v; + + ids.push_back(10); v.push_back(20); + ids.push_back(11); v.push_back(21); + ids.push_back(12); v.push_back(22); + ids.push_back(13); v.push_back(23); + + sql << "insert into soci_test(id, val) values(:id, :val)", + use(ids, "id"), use(v, "val"); + + int sum; + sql << "select sum(val) from soci_test", into(sum); + assert(sum == 86); + + // bulk inserts of some-null data + + sql << "delete from soci_test"; + + v[2].reset(); + v[3].reset(); + + sql << "insert into soci_test(id, val) values(:id, :val)", + use(ids, "id"), use(v, "val"); + + sql << "select sum(val) from soci_test", into(sum); + assert(sum == 41); + } + + // composability with user conversions + + { + sql << "delete from soci_test"; + + boost::optional<MyInt> omi1; + boost::optional<MyInt> omi2; + + omi1 = MyInt(125); + omi2.reset(); + + sql << "insert into soci_test(id, val) values(:id, :val)", + use(omi1), use(omi2); + + sql << "select id, val from soci_test", into(omi2), into(omi1); + + assert(omi1.is_initialized() == false); + assert(omi2.is_initialized() && omi2.get().get() == 125); + } + + // use with const optional and user conversions + + { + sql << "delete from soci_test"; + + boost::optional<MyInt> omi1; + boost::optional<MyInt> omi2; + + omi1 = MyInt(125); + omi2.reset(); + + boost::optional<MyInt> const & comi1 = omi1; + boost::optional<MyInt> const & comi2 = omi2; + + sql << "insert into soci_test(id, val) values(:id, :val)", + use(comi1), use(comi2); + + sql << "select id, val from soci_test", into(omi2), into(omi1); + + assert(omi1.is_initialized() == false); + assert(omi2.is_initialized() && omi2.get().get() == 125); + } + } + + std::cout << "test 26 passed" << std::endl; +} + +// connection and reconnection tests +void test27() +{ + { + // empty session + session sql; + + // idempotent: + sql.close(); + + try + { + sql.reconnect(); + assert(false); + } + catch (soci_error const &e) + { + assert(e.what() == std::string( + "Cannot reconnect without previous connection.")); + } + + // open from empty session + sql.open(backEndFactory_, connectString_); + sql.close(); + + // reconnecting from closed session + sql.reconnect(); + + // opening already connected session + try + { + sql.open(backEndFactory_, connectString_); + assert(false); + } + catch (soci_error const &e) + { + assert(e.what() == std::string( + "Cannot open already connected session.")); + } + + sql.close(); + + // open from closed + sql.open(backEndFactory_, connectString_); + + // reconnect from already connected session + sql.reconnect(); + } + + { + session sql; + + try + { + sql << "this statement cannot execute"; + assert(false); + } + catch (soci_error const &e) + { + assert(e.what() == std::string("Session is not connected.")); + } + } + + std::cout << "test 27 passed" << std::endl; +} + +void test28() +{ + session sql(backEndFactory_, connectString_); + + auto_table_creator tableCreator(tc_.table_creator_2(sql)); + { + boost::tuple<double, int, std::string> t1(3.5, 7, "Joe Hacker"); + assert(t1.get<0>() == 3.5); + assert(t1.get<1>() == 7); + assert(t1.get<2>() == "Joe Hacker"); + + sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); + + // basic query + + boost::tuple<double, int, std::string> t2; + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(t2.get<0>() == 3.5); + assert(t2.get<1>() == 7); + assert(t2.get<2>() == "Joe Hacker"); + + sql << "delete from soci_test"; + } + + { + // composability with boost::optional + + // use: + boost::tuple<double, boost::optional<int>, std::string> t1( + 3.5, boost::optional<int>(7), "Joe Hacker"); + assert(t1.get<0>() == 3.5); + assert(t1.get<1>().is_initialized()); + assert(t1.get<1>().get() == 7); + assert(t1.get<2>() == "Joe Hacker"); + + sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); + + // into: + boost::tuple<double, boost::optional<int>, std::string> t2; + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(t2.get<0>() == 3.5); + assert(t2.get<1>().is_initialized()); + assert(t2.get<1>().get() == 7); + assert(t2.get<2>() == "Joe Hacker"); + + sql << "delete from soci_test"; + } + + { + // composability with user-provided conversions + + // use: + boost::tuple<double, MyInt, std::string> t1(3.5, 7, "Joe Hacker"); + assert(t1.get<0>() == 3.5); + assert(t1.get<1>().get() == 7); + assert(t1.get<2>() == "Joe Hacker"); + + sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); + + // into: + boost::tuple<double, MyInt, std::string> t2; + + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(t2.get<0>() == 3.5); + assert(t2.get<1>().get() == 7); + assert(t2.get<2>() == "Joe Hacker"); + + sql << "delete from soci_test"; + } + + { + // let's have fun - composition of tuple, optional and user-defined type + + // use: + boost::tuple<double, boost::optional<MyInt>, std::string> t1( + 3.5, boost::optional<MyInt>(7), "Joe Hacker"); + assert(t1.get<0>() == 3.5); + assert(t1.get<1>().is_initialized()); + assert(t1.get<1>().get().get() == 7); + assert(t1.get<2>() == "Joe Hacker"); + + sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); + + // into: + boost::tuple<double, boost::optional<MyInt>, std::string> t2; + + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(t2.get<0>() == 3.5); + assert(t2.get<1>().is_initialized()); + assert(t2.get<1>().get().get() == 7); + assert(t2.get<2>() == "Joe Hacker"); + + sql << "update soci_test set num_int = NULL"; + + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(t2.get<0>() == 3.5); + assert(t2.get<1>().is_initialized() == false); + assert(t2.get<2>() == "Joe Hacker"); + } + + { + // rowset<tuple> + + sql << "insert into soci_test(num_float, num_int, name) values(4.0, 8, 'Tony Coder')"; + sql << "insert into soci_test(num_float, num_int, name) values(4.5, NULL, 'Cecile Sharp')"; + sql << "insert into soci_test(num_float, num_int, name) values(5.0, 10, 'Djhava Ravaa')"; + + typedef boost::tuple<double, boost::optional<int>, std::string> T; + + rowset<T> rs = (sql.prepare + << "select num_float, num_int, name from soci_test order by num_float asc"); + + rowset<T>::const_iterator pos = rs.begin(); + + assert(pos->get<0>() == 3.5); + assert(pos->get<1>().is_initialized() == false); + assert(pos->get<2>() == "Joe Hacker"); + + ++pos; + assert(pos->get<0>() == 4.0); + assert(pos->get<1>().is_initialized()); + assert(pos->get<1>().get() == 8); + assert(pos->get<2>() == "Tony Coder"); + + ++pos; + assert(pos->get<0>() == 4.5); + assert(pos->get<1>().is_initialized() == false); + assert(pos->get<2>() == "Cecile Sharp"); + + ++pos; + assert(pos->get<0>() == 5.0); + assert(pos->get<1>().is_initialized()); + assert(pos->get<1>().get() == 10); + assert(pos->get<2>() == "Djhava Ravaa"); + + ++pos; + assert(pos == rs.end()); + } + + std::cout << "test 28 passed" << std::endl; +} + +void test29() +{ +#if defined(BOOST_VERSION) && BOOST_VERSION >= 103500 + + session sql(backEndFactory_, connectString_); + + auto_table_creator tableCreator(tc_.table_creator_2(sql)); + { + boost::fusion::vector<double, int, std::string> t1(3.5, 7, "Joe Hacker"); + assert(boost::fusion::at_c<0>(t1) == 3.5); + assert(boost::fusion::at_c<1>(t1) == 7); + assert(boost::fusion::at_c<2>(t1) == "Joe Hacker"); + + sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); + + // basic query + + boost::fusion::vector<double, int, std::string> t2; + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(boost::fusion::at_c<0>(t2) == 3.5); + assert(boost::fusion::at_c<1>(t2) == 7); + assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); + + sql << "delete from soci_test"; + } + + { + // composability with boost::optional + + // use: + boost::fusion::vector<double, boost::optional<int>, std::string> t1( + 3.5, boost::optional<int>(7), "Joe Hacker"); + assert(boost::fusion::at_c<0>(t1) == 3.5); + assert(boost::fusion::at_c<1>(t1).is_initialized()); + assert(boost::fusion::at_c<1>(t1).get() == 7); + assert(boost::fusion::at_c<2>(t1) == "Joe Hacker"); + + sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); + + // into: + boost::fusion::vector<double, boost::optional<int>, std::string> t2; + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(boost::fusion::at_c<0>(t2) == 3.5); + assert(boost::fusion::at_c<1>(t2).is_initialized()); + assert(boost::fusion::at_c<1>(t2) == 7); + assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); + + sql << "delete from soci_test"; + } + + { + // composability with user-provided conversions + + // use: + boost::fusion::vector<double, MyInt, std::string> t1(3.5, 7, "Joe Hacker"); + assert(boost::fusion::at_c<0>(t1) == 3.5); + assert(boost::fusion::at_c<1>(t1).get() == 7); + assert(boost::fusion::at_c<2>(t1) == "Joe Hacker"); + + sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); + + // into: + boost::fusion::vector<double, MyInt, std::string> t2; + + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(boost::fusion::at_c<0>(t2) == 3.5); + assert(boost::fusion::at_c<1>(t2).get() == 7); + assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); + + sql << "delete from soci_test"; + } + + { + // let's have fun - composition of tuple, optional and user-defined type + + // use: + boost::fusion::vector<double, boost::optional<MyInt>, std::string> t1( + 3.5, boost::optional<MyInt>(7), "Joe Hacker"); + assert(boost::fusion::at_c<0>(t1) == 3.5); + assert(boost::fusion::at_c<1>(t1).is_initialized()); + assert(boost::fusion::at_c<1>(t1).get().get() == 7); + assert(boost::fusion::at_c<2>(t1) == "Joe Hacker"); + + sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); + + // into: + boost::fusion::vector<double, boost::optional<MyInt>, std::string> t2; + + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(boost::fusion::at_c<0>(t2) == 3.5); + assert(boost::fusion::at_c<1>(t2).is_initialized()); + assert(boost::fusion::at_c<1>(t2).get().get() == 7); + assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); + + sql << "update soci_test set num_int = NULL"; + + sql << "select num_float, num_int, name from soci_test", into(t2); + + assert(boost::fusion::at_c<0>(t2) == 3.5); + assert(boost::fusion::at_c<1>(t2).is_initialized() == false); + assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); + } + + { + // rowset<fusion::vector> + + sql << "insert into soci_test(num_float, num_int, name) values(4.0, 8, 'Tony Coder')"; + sql << "insert into soci_test(num_float, num_int, name) values(4.5, NULL, 'Cecile Sharp')"; + sql << "insert into soci_test(num_float, num_int, name) values(5.0, 10, 'Djhava Ravaa')"; + + typedef boost::fusion::vector<double, boost::optional<int>, std::string> T; + + rowset<T> rs = (sql.prepare + << "select num_float, num_int, name from soci_test order by num_float asc"); + + rowset<T>::const_iterator pos = rs.begin(); + + assert(boost::fusion::at_c<0>(*pos) == 3.5); + assert(boost::fusion::at_c<1>(*pos).is_initialized() == false); + assert(boost::fusion::at_c<2>(*pos) == "Joe Hacker"); + + ++pos; + assert(boost::fusion::at_c<0>(*pos) == 4.0); + assert(boost::fusion::at_c<1>(*pos).is_initialized()); + assert(boost::fusion::at_c<1>(*pos).get() == 8); + assert(boost::fusion::at_c<2>(*pos) == "Tony Coder"); + + ++pos; + assert(boost::fusion::at_c<0>(*pos) == 4.5); + assert(boost::fusion::at_c<1>(*pos).is_initialized() == false); + assert(boost::fusion::at_c<2>(*pos) == "Cecile Sharp"); + + ++pos; + assert(boost::fusion::at_c<0>(*pos) == 5.0); + assert(boost::fusion::at_c<1>(*pos).is_initialized()); + assert(boost::fusion::at_c<1>(*pos).get() == 10); + assert(boost::fusion::at_c<2>(*pos) == "Djhava Ravaa"); + + ++pos; + assert(pos == rs.end()); + } + + std::cout << "test 29 passed" << std::endl; + +#else + std::cout << "test 29 skipped (no boost::fusion)" << std::endl; +#endif // BOOST_VERSION +} + +// test for boost::gregorian::date +void test30() +{ + session sql(backEndFactory_, connectString_); + + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + + std::tm nov15; + nov15.tm_year = 105; + nov15.tm_mon = 10; + nov15.tm_mday = 15; + nov15.tm_hour = 0; + nov15.tm_min = 0; + nov15.tm_sec = 0; + + sql << "insert into soci_test(tm) values(:tm)", use(nov15); + + boost::gregorian::date bgd; + sql << "select tm from soci_test", into(bgd); + + assert(bgd.year() == 2005); + assert(bgd.month() == 11); + assert(bgd.day() == 15); + + sql << "update soci_test set tm = NULL"; + try + { + sql << "select tm from soci_test", into(bgd); + assert(false); + } + catch (soci_error const & e) + { + assert(e.what() == std::string("Null value not allowed for this type")); + } + } + + { + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + + boost::gregorian::date bgd(2008, boost::gregorian::May, 5); + + sql << "insert into soci_test(tm) values(:tm)", use(bgd); + + std::tm t; + sql << "select tm from soci_test", into(t); + + assert(t.tm_year == 108); + assert(t.tm_mon == 4); + assert(t.tm_mday == 5); + } + + std::cout << "test 30 passed" << std::endl; +} + +}; // class common_tests } // namespace tests -} // namespace SOCI -#endif // COMMON_TESTS_H_INCLUDED +} // namespace soci +#endif // SOCI_COMMON_TESTS_H_INCLUDED diff --git a/src/core/transaction.cpp b/src/core/transaction.cpp new file mode 100644 index 00000000..5c77094c --- /dev/null +++ b/src/core/transaction.cpp @@ -0,0 +1,52 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "transaction.h" +#include "error.h" + +using namespace soci; + +transaction::transaction(session & sql) + : handled_(false), sql_(sql) +{ + sql_.begin(); +} + +transaction::~transaction() +{ + if (handled_ == false) + { + try + { + rollback(); + } + catch (...) {} + } +} + +void transaction::commit() +{ + if (handled_) + { + throw soci_error("The transaction object cannot be handled twice."); + } + + sql_.commit(); + handled_ = true; +} + +void transaction::rollback() +{ + if (handled_) + { + throw soci_error("The transaction object cannot be handled twice."); + } + + sql_.rollback(); + handled_ = true; +} diff --git a/src/core/transaction.h b/src/core/transaction.h new file mode 100644 index 00000000..b41259e2 --- /dev/null +++ b/src/core/transaction.h @@ -0,0 +1,36 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_TRANSACTION_H_INCLUDED +#define SOCI_TRANSACTION_H_INCLUDED + +#include "session.h" +#include "soci-config.h" + +#include <string> + +namespace soci +{ + +class SOCI_DECL transaction +{ +public: + explicit transaction(session & sql); + + ~transaction(); + + void commit(); + void rollback(); + +private: + bool handled_; + session & sql_; +}; + +} // namespace soci + +#endif // SOCI_TRANSACTION_H_INCLUDED diff --git a/src/core/type-conversion-traits.h b/src/core/type-conversion-traits.h new file mode 100644 index 00000000..5a539d2f --- /dev/null +++ b/src/core/type-conversion-traits.h @@ -0,0 +1,41 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_TYPE_CONVERSION_TRAITS_H_INCLUDED +#define SOCI_TYPE_CONVERSION_TRAITS_H_INCLUDED + +#include "soci-backend.h" + +namespace soci +{ + +// default traits class type_conversion, acts as pass through for row::get() +// when no actual conversion is needed. +template <typename T> +struct type_conversion +{ + typedef T base_type; + + static void from_base(base_type const & in, indicator ind, T & out) + { + if (ind == i_null) + { + throw soci_error("Null value not allowed for this type"); + } + out = in; + } + + static void to_base(T const & in, base_type & out, indicator & ind) + { + out = in; + ind = i_ok; + } +}; + +} // namespace soci + +#endif // SOCI_TYPE_CONVERSION_TRAITS_H_INCLUDED diff --git a/src/core/type-conversion.h b/src/core/type-conversion.h new file mode 100644 index 00000000..1af65ad5 --- /dev/null +++ b/src/core/type-conversion.h @@ -0,0 +1,295 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_TYPE_CONVERSION_H_INCLUDED +#define SOCI_TYPE_CONVERSION_H_INCLUDED + +#include "type-conversion-traits.h" +#include "into-type.h" +#include "use-type.h" + +#include <vector> + +namespace soci +{ + +namespace details +{ + +// this class is used to ensure correct order of construction +// of into_type and use_type elements that use type_conversion + +template <typename T> +struct base_value_holder +{ + typename type_conversion<T>::base_type val_; +}; + +// Automatically create into_type from a type_conversion + +template <typename T> +class conversion_into_type + : private base_value_holder<T>, + public into_type<typename type_conversion<T>::base_type> +{ +public: + typedef typename type_conversion<T>::base_type BASE_TYPE; + + conversion_into_type(T & value) + : into_type<BASE_TYPE>(details::base_value_holder<T>::val_, ownInd_), + value_(value), ind_(ownInd_) {} + conversion_into_type(T & value, indicator & ind) + : into_type<BASE_TYPE>(details::base_value_holder<T>::val_, ind), + value_(value), ind_(ind) {} + +private: + void convert_from_base() + { + type_conversion<T>::from_base( + details::base_value_holder<T>::val_, ind_, value_); + } + + T & value_; + + indicator ownInd_; + + // ind_ refers to either ownInd_, or the one provided by the user + // in any case, ind_ refers to some valid indicator + // and can be used by conversion routines + indicator & ind_; +}; + +// Automatically create use_type from a type_conversion + +template <typename T> +class conversion_use_type + : private details::base_value_holder<T>, + public use_type<typename type_conversion<T>::base_type> +{ +public: + typedef typename type_conversion<T>::base_type BASE_TYPE; + + conversion_use_type(T & value, std::string const & name = std::string()) + : use_type<BASE_TYPE>(details::base_value_holder<T>::val_, + ownInd_, name), + value_(value), ind_(ownInd_), readOnly_(false) {} + conversion_use_type(T const & value, std::string const & name = std::string()) + : use_type<BASE_TYPE>(details::base_value_holder<T>::val_, + ownInd_, name), + value_(const_cast<T &>(value)), ind_(ownInd_), readOnly_(true) {} + conversion_use_type(T & value, indicator & ind, std::string const & name + = std::string()) + : use_type<BASE_TYPE>(details::base_value_holder<T>::val_, ind, name), + value_(value), ind_(ind), readOnly_(false) {} + conversion_use_type(T const & value, indicator & ind, std::string const & name + = std::string()) + : use_type<BASE_TYPE>(details::base_value_holder<T>::val_, ind, name), + value_(const_cast<T &>(value)), ind_(ind), readOnly_(true) {} + + void convert_from_base() + { + if (readOnly_ == false) + { + type_conversion<T>::from_base( + details::base_value_holder<T>::val_, ind_, value_); + } + } + + void convert_to_base() + { + type_conversion<T>::to_base(value_, + details::base_value_holder<T>::val_, ind_); + } + +private: + T & value_; + + indicator ownInd_; + + // ind_ refers to either ownInd_, or the one provided by the user + // in any case, ind_ refers to some valid indicator + // and can be used by conversion routines + indicator & ind_; + + bool readOnly_; +}; + +// this class is used to ensure correct order of construction +// of vector based into_type and use_type elements that use type_conversion + +template <typename T> +struct base_vector_holder +{ + base_vector_holder(std::size_t sz = 0) : vec_(sz) {} + mutable std::vector<typename type_conversion<T>::base_type> vec_; +}; + +// Automatically create a std::vector based into_type from a type_conversion + +template <typename T> +class conversion_into_type<std::vector<T> > + : private details::base_vector_holder<T>, + public into_type<std::vector<typename type_conversion<T>::base_type> > +{ +public: + typedef typename std::vector<typename type_conversion<T>::base_type> + BASE_TYPE; + + conversion_into_type(std::vector<T> & value) + : details::base_vector_holder<T>(value.size()), + into_type<BASE_TYPE>(details::base_vector_holder<T>::vec_, ownInd_), + value_(value), ind_(ownInd_) {} + + conversion_into_type(std::vector<T> & value, std::vector<indicator> & ind) + : details::base_vector_holder<T>(value.size()), + into_type<BASE_TYPE>(details::base_vector_holder<T>::vec_, ind), + value_(value), ind_(ind) {} + + virtual std::size_t size() const + { + // the user might have resized his vector in the meantime + // -> synchronize the base-value mirror to have the same size + + std::size_t const userSize = value_.size(); + details::base_vector_holder<T>::vec_.resize(userSize); + return userSize; + } + + virtual void resize(std::size_t sz) + { + value_.resize(sz); + ind_.resize(sz); + details::base_vector_holder<T>::vec_.resize(sz); + } + +private: + void convert_from_base() + { + std::size_t const sz = details::base_vector_holder<T>::vec_.size(); + + for (std::size_t i = 0; i != sz; ++i) + { + type_conversion<T>::from_base( + details::base_vector_holder<T>::vec_[i], ind_[i], value_[i]); + } + } + + std::vector<T> & value_; + + std::vector<indicator> ownInd_; + + // ind_ refers to either ownInd_, or the one provided by the user + // in any case, ind_ refers to some valid vector of indicators + // and can be used by conversion routines + std::vector<indicator> & ind_; +}; + + +// Automatically create a std::vector based use_type from a type_conversion + +template <typename T> +class conversion_use_type<std::vector<T> > + : private details::base_vector_holder<T>, + public use_type<std::vector<typename type_conversion<T>::base_type> > +{ +public: + typedef typename std::vector<typename type_conversion<T>::base_type> + BASE_TYPE; + + conversion_use_type(std::vector<T> & value, + std::string const & name=std::string()) + : details::base_vector_holder<T>(value.size()), + use_type<BASE_TYPE>(details::base_vector_holder<T>::vec_, + ownInd_, name), + value_(value), ind_(ownInd_) {} + + conversion_use_type(std::vector<T> & value, + std::vector<indicator> const & ind, + std::string const & name=std::string()) + : details::base_vector_holder<T>(value.size()), + use_type<BASE_TYPE>(details::base_vector_holder<T>::vec_, + ind, name), + value_(value), ind_(ind) {} + +private: + void convert_from_base() + { + std::size_t const sz = details::base_vector_holder<T>::vec_.size(); + value_.resize(sz); + ind_.resize(sz); + for (std::size_t i = 0; i != sz; ++i) + { + type_conversion<T>::from_base( + details::base_vector_holder<T>::vec_[i], value_[i], ind_[i]); + } + } + + void convert_to_base() + { + std::size_t const sz = value_.size(); + details::base_vector_holder<T>::vec_.resize(sz); + ind_.resize(sz); + for (std::size_t i = 0; i != sz; ++i) + { + type_conversion<T>::to_base(value_[i], + details::base_vector_holder<T>::vec_[i], ind_[i]); + } + } + + std::vector<T> & value_; + + std::vector<indicator> ownInd_; + + // ind_ refers to either ownInd_, or the one provided by the user + // in any case, ind_ refers to some valid vector of indicators + // and can be used by conversion routines + std::vector<indicator> & ind_; +}; + +template <typename T> +into_type_ptr do_into(T & t, user_type_tag) +{ + return into_type_ptr(new conversion_into_type<T>(t)); +} + +template <typename T> +into_type_ptr do_into(T & t, indicator & ind, user_type_tag) +{ + return into_type_ptr(new conversion_into_type<T>(t, ind)); +} + +template <typename T> +use_type_ptr do_use(T & t, std::string const & name, user_type_tag) +{ + return use_type_ptr(new conversion_use_type<T>(t, name)); +} + +template <typename T> +use_type_ptr do_use(T const & t, std::string const & name, user_type_tag) +{ + return use_type_ptr(new conversion_use_type<T>(t, name)); +} + +template <typename T> +use_type_ptr do_use(T & t, indicator & ind, + std::string const & name, user_type_tag) +{ + return use_type_ptr(new conversion_use_type<T>(t, ind, name)); +} + +template <typename T> +use_type_ptr do_use(T const & t, indicator & ind, + std::string const & name, user_type_tag) +{ + return use_type_ptr(new conversion_use_type<T>(t, ind, name)); +} + +} // namespace details + +} // namespace soci + +#endif // SOCI_TYPE_CONVERSION_H_INCLUDED diff --git a/src/core/type-holder.h b/src/core/type-holder.h new file mode 100644 index 00000000..dcf7c4c0 --- /dev/null +++ b/src/core/type-holder.h @@ -0,0 +1,65 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_TYPE_HOLDER_H_INCLUDED +#define SOCI_TYPE_HOLDER_H_INCLUDED + +#include <typeinfo> + +namespace soci +{ + +namespace details +{ + +// Base class holder + derived class type_holder for storing type data +// instances in a container of holder objects +template <typename T> +class type_holder; + +class holder +{ +public: + holder() {} + virtual ~holder() {} + + template<typename T> + T get() + { + type_holder<T> * p = dynamic_cast<type_holder<T> *>(this); + if (p) + { + return p->value<T>(); + } + else + { + throw std::bad_cast(); + } + } + +private: + template<typename T> T value(); +}; + +template <typename T> +class type_holder : public holder +{ +public: + type_holder(T * t) : t_(t) {} + ~type_holder() { delete t_; } + + template<typename TVAL> TVAL value() const { return *t_; } + +private: + T * t_; +}; + +} // namespace details + +} // namespace soci + +#endif // SOCI_TYPE_HOLDER_H_INCLUDED diff --git a/src/core/type-ptr.h b/src/core/type-ptr.h new file mode 100644 index 00000000..b1c28c23 --- /dev/null +++ b/src/core/type-ptr.h @@ -0,0 +1,35 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_TYPE_PTR_H_INCLUDED +#define SOCI_TYPE_PTR_H_INCLUDED + +namespace soci +{ + +namespace details +{ + +template <typename T> +class type_ptr +{ +public: + type_ptr(T * p) : p_(p) {} + ~type_ptr() { delete p_; } + + T * get() const { return p_; } + void release() const { p_ = NULL; } + +private: + mutable T * p_; +}; + +} // namespace details + +} // namespace soci + +#endif // SOCI_TYPE_PTR_H_INCLUDED diff --git a/src/core/use-type.cpp b/src/core/use-type.cpp new file mode 100644 index 00000000..99374f2d --- /dev/null +++ b/src/core/use-type.cpp @@ -0,0 +1,89 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "use-type.h" +#include "statement.h" + +using namespace soci; +using namespace soci::details; + +standard_use_type::~standard_use_type() +{ + delete backEnd_; +} + +void standard_use_type::bind(statement_impl & st, int & position) +{ + backEnd_ = st.make_use_type_backend(); + if (name_.empty()) + { + backEnd_->bind_by_pos(position, data_, type_, readOnly_); + } + else + { + backEnd_->bind_by_name(name_, data_, type_, readOnly_); + } +} + +void standard_use_type::pre_use() +{ + convert_to_base(); + backEnd_->pre_use(ind_); +} + +void standard_use_type::post_use(bool gotData) +{ + backEnd_->post_use(gotData, ind_); + convert_from_base(); +} + +void standard_use_type::clean_up() +{ + if (backEnd_ != NULL) + { + backEnd_->clean_up(); + } +} + +vector_use_type::~vector_use_type() +{ + delete backEnd_; +} + +void vector_use_type::bind(statement_impl & st, int & position) +{ + backEnd_ = st.make_vector_use_type_backend(); + if (name_.empty()) + { + backEnd_->bind_by_pos(position, data_, type_); + } + else + { + backEnd_->bind_by_name(name_, data_, type_); + } +} + +void vector_use_type::pre_use() +{ + convert_to_base(); + + backEnd_->pre_use(ind_ ? &ind_->at(0) : NULL); +} + +std::size_t vector_use_type::size() const +{ + return backEnd_->size(); +} + +void vector_use_type::clean_up() +{ + if (backEnd_ != NULL) + { + backEnd_->clean_up(); + } +} diff --git a/src/core/use-type.h b/src/core/use-type.h new file mode 100644 index 00000000..2eab5328 --- /dev/null +++ b/src/core/use-type.h @@ -0,0 +1,250 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_USE_TYPE_H_INCLUDED +#define SOCI_USE_TYPE_H_INCLUDED + +#include "soci-backend.h" +#include "type-ptr.h" +#include "exchange-traits.h" + +#include <string> +#include <vector> + +namespace soci +{ + +namespace details +{ + +class statement_impl; + +// this is intended to be a base class for all classes that deal with +// binding input data (and OUT PL/SQL variables) +class SOCI_DECL use_type_base +{ +public: + virtual ~use_type_base() {} + + virtual void bind(statement_impl & st, int & position) = 0; + virtual void pre_use() = 0; + virtual void post_use(bool gotData) = 0; + virtual void clean_up() = 0; + + virtual std::size_t size() const = 0; // returns the number of elements +}; + +typedef type_ptr<use_type_base> use_type_ptr; + +class SOCI_DECL standard_use_type : public use_type_base +{ +public: + standard_use_type(void * data, exchange_type type, + bool readOnly, std::string const & name = std::string()) + : data_(data), type_(type), ind_(NULL), + readOnly_(readOnly), name_(name), backEnd_(NULL) {} + standard_use_type(void * data, exchange_type type, indicator & ind, + bool readOnly, std::string const & name = std::string()) + : data_(data), type_(type), ind_(&ind), + readOnly_(readOnly), name_(name), backEnd_(NULL) {} + + virtual ~standard_use_type(); + virtual void bind(statement_impl & st, int & position); + std::string get_name() const {return name_;} + virtual void * get_data() {return data_;} + + // conversion hook (from arbitrary user type to base type) + virtual void convert_to_base() {} + virtual void convert_from_base() {} + +protected: + virtual void pre_use(); + +private: + virtual void post_use(bool gotData); + virtual void clean_up(); + virtual std::size_t size() const { return 1; } + + void * data_; + exchange_type type_; + indicator * ind_; + bool readOnly_; + std::string name_; + + standard_use_type_backend * backEnd_; +}; + +class SOCI_DECL vector_use_type : public use_type_base +{ +public: + vector_use_type(void * data, exchange_type type, + std::string const & name = std::string()) + : data_(data), type_(type), ind_(NULL), + name_(name), backEnd_(NULL) {} + + vector_use_type(void * data, exchange_type type, + std::vector<indicator> const & ind, + std::string const & name = std::string()) + : data_(data), type_(type), ind_(&ind), + name_(name), backEnd_(NULL) {} + + ~vector_use_type(); + +private: + virtual void bind(statement_impl & st, int & position); + virtual void pre_use(); + virtual void post_use(bool) { /* nothing to do */ } + virtual void clean_up(); + virtual std::size_t size() const; + + void * data_; + exchange_type type_; + std::vector<indicator> const * ind_; + std::string name_; + + vector_use_type_backend * backEnd_; + + virtual void convert_to_base() {} +}; + +// implementation for the basic types (those which are supported by the library +// out of the box without user-provided conversions) + +template <typename T> +class use_type : public standard_use_type +{ +public: + use_type(T & t, std::string const & name = std::string()) + : standard_use_type(&t, + static_cast<exchange_type>(exchange_traits<T>::x_type), + false, name) {} + use_type(T const & t, std::string const & name = std::string()) + : standard_use_type(const_cast<T *>(&t), + static_cast<exchange_type>(exchange_traits<T>::x_type), + true, name) {} + use_type(T & t, indicator & ind, + std::string const & name = std::string()) + : standard_use_type(&t, + static_cast<exchange_type>(exchange_traits<T>::x_type), + ind, false, name) {} + use_type(T const & t, indicator & ind, + std::string const & name = std::string()) + : standard_use_type(const_cast<T *>(&t), + static_cast<exchange_type>(exchange_traits<T>::x_type), + ind, false, name) {} +}; + +template <typename T> +class use_type<std::vector<T> > : public vector_use_type +{ +public: + use_type(std::vector<T> & v, std::string const & name = std::string()) + : vector_use_type(&v, + static_cast<exchange_type>(exchange_traits<T>::x_type), name) {} + use_type(std::vector<T> const & v, std::string const & name = std::string()) + : vector_use_type(const_cast<std::vector<T> *>(&v), + static_cast<exchange_type>(exchange_traits<T>::x_type), name) {} + use_type(std::vector<T> & v, std::vector<indicator> const & ind, + std::string const & name = std::string()) + : vector_use_type(&v, + static_cast<exchange_type>(exchange_traits<T>::x_type), + ind, name) {} + use_type(std::vector<T> const & v, std::vector<indicator> const & ind, + std::string const & name = std::string()) + : vector_use_type(const_cast<std::vector<T> *>(&v), + static_cast<exchange_type>(exchange_traits<T>::x_type), + ind, name) {} +}; + +// special cases for char* and char[] + +template <> +class use_type<char *> : public standard_use_type +{ +public: + use_type(char * str, std::size_t bufSize, + std::string const & name = std::string()) + : standard_use_type(&str_, x_cstring, false, name), str_(str, bufSize) {} + use_type(char const * str, std::size_t bufSize, + std::string const & name = std::string()) + : standard_use_type(&str_, x_cstring, true, name), + str_(const_cast<char *>(str), bufSize) {} + use_type(char * str, indicator & ind, std::size_t bufSize, + std::string const & name = std::string()) + : standard_use_type(&str_, x_cstring, ind, false, name), str_(str, bufSize) {} + use_type(char const * str, indicator & ind, std::size_t bufSize, + std::string const & name = std::string()) + : standard_use_type(&str_, x_cstring, ind, true, name), + str_(const_cast<char *>(str), bufSize) {} + +private: + cstring_descriptor str_; +}; + +template <std::size_t N> +class use_type<char[N]> : public use_type<char *> +{ +public: + use_type(char str[], std::string const & name = std::string()) + : use_type<char *>(str, N, name) {} + use_type(char const str[], std::string const & name = std::string()) + : use_type<char *>(str, N, name) {} + use_type(char str[], indicator & ind, + std::string const & name = std::string()) + : use_type<char *>(str, ind, N, name) {} + use_type(char const str[], indicator & ind, + std::string const & name = std::string()) + : use_type<char *>(str, ind, N, name) {} +}; + +// helper dispatchers for basic types + +template <typename T> +use_type_ptr do_use(T & t, std::string const & name, basic_type_tag) +{ + return use_type_ptr(new use_type<T>(t, name)); +} + +template <typename T> +use_type_ptr do_use(T const & t, std::string const & name, basic_type_tag) +{ + return use_type_ptr(new use_type<T>(t, name)); +} + +template <typename T> +use_type_ptr do_use(T & t, indicator & ind, + std::string const & name, basic_type_tag) +{ + return use_type_ptr(new use_type<T>(t, ind, name)); +} + +template <typename T> +use_type_ptr do_use(T const & t, indicator & ind, + std::string const & name, basic_type_tag) +{ + return use_type_ptr(new use_type<T>(t, ind, name)); +} + +template <typename T> +use_type_ptr do_use(T & t, std::vector<indicator> & ind, + std::string const & name, basic_type_tag) +{ + return use_type_ptr(new use_type<T>(t, ind, name)); +} + +template <typename T> +use_type_ptr do_use(T const & t, std::vector<indicator> & ind, + std::string const & name, basic_type_tag) +{ + return use_type_ptr(new use_type<T>(t, ind, name)); +} + +} // namespace details + +} // namesapce soci + +#endif // SOCI_USE_TYPE_H_INCLUDED diff --git a/src/core/use.h b/src/core/use.h new file mode 100644 index 00000000..f5c05b3f --- /dev/null +++ b/src/core/use.h @@ -0,0 +1,62 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_USE_H_INCLUDED +#define SOCI_USE_H_INCLUDED + +#include "use-type.h" +#include "exchange-traits.h" +#include "type-conversion.h" + +namespace soci +{ + +// the use function is a helper for defining input variables +// these helpers work with both basic and user-defined types thanks to +// the tag-dispatching, as defined in exchange_traits template + +template <typename T> +details::use_type_ptr use(T & t, std::string const & name = std::string()) +{ + return details::do_use(t, name, + typename details::exchange_traits<T>::type_family()); +} + +template <typename T> +details::use_type_ptr use(T const & t, std::string const & name = std::string()) +{ + return details::do_use(t, name, + typename details::exchange_traits<T>::type_family()); +} + +template <typename T> +details::use_type_ptr use(T & t, indicator & ind, + std::string const &name = std::string()) +{ + return details::do_use(t, ind, name, + typename details::exchange_traits<T>::type_family()); +} + +template <typename T> +details::use_type_ptr use(T & t, std::vector<indicator> & ind, + std::string const & name = std::string()) +{ + return details::do_use(t, ind, name, + typename details::exchange_traits<T>::type_family()); +} + +// for char buffer with run-time size information +template <typename T> +details::use_type_ptr use(T & t, std::size_t bufSize, + std::string const & name = std::string()) +{ + return details::use_type_ptr(new details::use_type<T>(t, bufSize)); +} + +} // namespace soci + +#endif // SOCI_USE_H_INCLUDED diff --git a/src/core/values-exchange.h b/src/core/values-exchange.h new file mode 100644 index 00000000..2e5fd0b9 --- /dev/null +++ b/src/core/values-exchange.h @@ -0,0 +1,108 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_VALUES_EXCHANGE_H_INCLUDED +#define SOCI_VALUES_EXCHANGE_H_INCLUDED + +#include "values.h" +#include "into-type.h" +#include "use-type.h" +#include "row-exchange.h" +#include <vector> + +namespace soci +{ + +namespace details +{ + +template <> +struct exchange_traits<values> +{ + typedef basic_type_tag type_family; + + // dummy value to satisfy the template engine, never used + enum { x_type = 0 }; +}; + +template <> +class use_type<values> : public use_type_base +{ +public: + use_type(values & v, std::string const & /* name */ = std::string()) + : v_(v) {} + + // we ignore the possibility to have the whole values as NULL + use_type(values & v, indicator /* ind */, std::string const & /* name */ = std::string()) + : v_(v) {} + + virtual void bind(details::statement_impl & st, int & /*position*/) + { + v_.uppercase_column_names(st.session_.get_uppercase_column_names()); + + convert_to_base(); + st.bind(v_); + } + + virtual void post_use(bool /*gotData*/) + { + v_.reset_get_counter(); + convert_from_base(); + } + + virtual void pre_use() {} + virtual void clean_up() {v_.clean_up();} + virtual std::size_t size() const { return 1; } + + // these are used only to re-dispatch to derived class + // (the derived class might be generated automatically by + // user conversions) + virtual void convert_to_base() {} + virtual void convert_from_base() {} + +private: + values & v_; +}; + +// this is not supposed to be used - no support for bulk ORM +template <> +class use_type<std::vector<values> > +{ +private: + use_type(); +}; + +template <> +class into_type<values> : public into_type<row> +{ +public: + into_type(values & v) : into_type<row>(v.get_row()), v_(v) {} + into_type(values & v, indicator & ind) + : into_type<row>(v.get_row(), ind), v_(v) {} + + void clean_up() + { + v_.clean_up(); + } + +private: + values & v_; +}; + +// this is not supposed to be used - no support for bulk ORM +template <> +class into_type<std::vector<values> > +{ +private: + into_type(); +}; + +} // namespace details + +} // namespace soci + +#endif // SOCI_VALUES_EXCHANGE_H_INCLUDED diff --git a/src/core/values.cpp b/src/core/values.cpp new file mode 100644 index 00000000..46458d19 --- /dev/null +++ b/src/core/values.cpp @@ -0,0 +1,44 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_SOURCE +#include "values.h" +#include "row.h" + +using namespace soci; +using namespace soci::details; + +indicator values::get_indicator(std::size_t pos) const +{ + if (row_) + { + return row_->get_indicator(pos); + } + else + { + return *indicators_[pos]; + } +} + +indicator values::get_indicator(std::string const & name) const +{ + if (row_) + { + return row_->get_indicator(name); + } + else + { + std::map<std::string, std::size_t>::const_iterator it = index_.find(name); + if (it == index_.end()) + { + std::ostringstream msg; + msg << "Column '" << name << "' not found"; + throw soci_error(msg.str()); + } + return *indicators_[it->second]; + } +} diff --git a/src/core/values.h b/src/core/values.h new file mode 100644 index 00000000..8d7cc2dc --- /dev/null +++ b/src/core/values.h @@ -0,0 +1,323 @@ +// +// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_VALUES_H_INCLUDED +#define SOCI_VALUES_H_INCLUDED + +#include "statement.h" +#include "into-type.h" +#include "use-type.h" + +#include <sstream> + +namespace soci +{ + +namespace details +{ + +class copy_base +{ +public: + virtual ~copy_base() {} +}; + +template <typename T> +struct copy_holder : public copy_base +{ + copy_holder(T const & v) : value_(v) {} + + T value_; +}; + +} // namespace details + +class SOCI_DECL values +{ + friend class details::statement_impl; + friend class details::into_type<values>; + friend class details::use_type<values>; + +public: + + values() : row_(NULL), currentPos_(0), uppercaseColumnNames_(false) {} + + indicator get_indicator(std::size_t pos) const; + indicator get_indicator(std::string const & name) const; + + template <typename T> + T get(std::size_t pos) const + { + if (row_ != NULL) + { + return row_->get<T>(pos); + } + else if (*indicators_[pos] != i_null) + { + return get_from_uses<T>(pos); + } + else + { + std::ostringstream msg; + msg << "Column at position " + << static_cast<unsigned long>(pos) + << " contains NULL value and no default was provided"; + throw soci_error(msg.str()); + } + } + + template <typename T> + T get(std::size_t pos, T const & nullValue) const + { + if (row_ != NULL) + { + return row_->get<T>(pos, nullValue); + } + else if (*indicators_[pos] == i_null) + { + return nullValue; + } + else + { + return get_from_uses<T>(pos); + } + } + + template <typename T> + T get(std::string const & name) const + { + return row_ != NULL ? row_->get<T>(name) : get_from_uses<T>(name); + } + + template <typename T> + T get(std::string const & name, T const & nullValue) const + { + return row_ != NULL ? row_->get<T>(name, nullValue) + : get_from_uses<T>(name, nullValue); + } + + template <typename T> + values const & operator>>(T & value) const + { + if (row_ != NULL) + { + // row maintains its own position counter + // which is automatically reset when needed + + *row_ >> value; + } + else if (*indicators_[currentPos_] != i_null) + { + // if there is no row object, then the data can be + // extracted from the locally stored use elements, + // but for this the position counter has to be maintained + // as well + + value = get_from_uses<T>(currentPos_); + ++currentPos_; + } + else + { + std::ostringstream msg; + msg << "Column at position " + << static_cast<unsigned long>(currentPos_) + << " contains NULL value and no default was provided"; + throw soci_error(msg.str()); + } + + return *this; + } + + void skip(std::size_t num = 1) const + { + if (row_ != NULL) + { + row_->skip(num); + } + else + { + currentPos_ += num; + } + } + + void reset_get_counter() const + { + if (row_ != NULL) + { + row_->reset_get_counter(); + } + else + { + currentPos_ = 0; + } + } + + template <typename T> + void set(std::string const & name, T const & value, indicator indic = i_ok) + { + index_.insert(std::make_pair(name, uses_.size())); + + indicator * pind = new indicator(indic); + indicators_.push_back(pind); + + typedef typename type_conversion<T>::base_type base_type; + base_type baseValue; + if (indic == i_ok) + { + type_conversion<T>::to_base(value, baseValue, *pind); + } + + details::copy_holder<base_type> * pcopy = + new details::copy_holder<base_type>(baseValue); + deepCopies_.push_back(pcopy); + + uses_.push_back(new details::use_type<base_type>( + pcopy->value_, *pind, name)); + } + + template <typename T> + void set(const T & value, indicator indic = i_ok) + { + indicator * pind = new indicator(indic); + indicators_.push_back(pind); + + typedef typename type_conversion<T>::base_type base_type; + base_type baseValue; + type_conversion<T>::to_base(value, baseValue, *pind); + + details::copy_holder<base_type> * pcopy = + new details::copy_holder<base_type>(baseValue); + deepCopies_.push_back(pcopy); + + uses_.push_back(new details::use_type<base_type>( + pcopy->value_, *pind)); + } + + template <typename T> + values & operator<<(T const & value) + { + set(value); + return *this; + } + + void uppercase_column_names(bool forceToUpper) + { uppercaseColumnNames_ = forceToUpper; } + +private: + + //TODO To make values generally usable outside of TypeConversionS, + // these should be reference counted smart pointers + row * row_; + std::vector<details::standard_use_type *> uses_; + std::map<details::use_type_base *, indicator *> unused_; + std::vector<indicator *> indicators_; + std::map<std::string, std::size_t> index_; + std::vector<details::copy_base *> deepCopies_; + + mutable std::size_t currentPos_; + + bool uppercaseColumnNames_; + + // When TypeConversion::to() is called, a values object is created + // without an underlying row object. In that case, get_from_uses() + // returns the underlying field values + template <typename T> + T get_from_uses(std::string const & name, T const & nullValue) const + { + std::map<std::string, std::size_t>::const_iterator pos = index_.find(name); + if (pos != index_.end()) + { + if (*indicators_[pos->second] == i_null) + { + return nullValue; + } + + return get_from_uses<T>(pos->second); + } + throw soci_error("Value named " + name + " not found."); + } + + template <typename T> + T get_from_uses(std::string const & name) const + { + std::map<std::string, std::size_t>::const_iterator pos = index_.find(name); + if (pos != index_.end()) + { + return get_from_uses<T>(pos->second); + } + throw soci_error("Value named " + name + " not found."); + } + + template <typename T> + T get_from_uses(std::size_t pos) const + { + details::standard_use_type* u = uses_[pos]; + + typedef typename type_conversion<T>::base_type base_type; + + if (dynamic_cast<details::use_type<base_type> *>(u)) + { + base_type const & baseValue = *static_cast<base_type*>(u->get_data()); + + T val; + indicator ind = *indicators_[pos]; + type_conversion<T>::from_base(baseValue, ind, val); + return val; + } + else + { + std::ostringstream msg; + msg << "Value at position " + << static_cast<unsigned long>(pos) + << " was set using a different type" + " than the one passed to get()"; + throw soci_error(msg.str()); + } + } + + row& get_row() + { + row_ = new row(); + row_->uppercase_column_names(uppercaseColumnNames_); + + return * row_; + } + + // this is called by Statement::bind(values) + void add_unused(details::use_type_base * u, indicator * i) + { + static_cast<details::standard_use_type *>(u)->convert_to_base(); + unused_.insert(std::make_pair(u, i)); + } + + // this is called by details::into_type<values>::clean_up() + // and use_type<values>::clean_up() + void clean_up() + { + delete row_; + row_ = NULL; + + // delete any uses and indicators which were created by set() but + // were not bound by the Statement + // (bound uses and indicators are deleted in Statement::clean_up()) + for (std::map<details::use_type_base *, indicator *>::iterator pos = + unused_.begin(); pos != unused_.end(); ++pos) + { + delete pos->first; + delete pos->second; + } + + for (std::size_t i = 0; i != deepCopies_.size(); ++i) + { + delete deepCopies_[i]; + } + } +}; + +} // namespace soci + +#endif // SOCI_VALUES_H_INCLUDED -- GitLab