Initial commit
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
[Dolphin]
|
||||
Timestamp=2015,3,20,16,24,3
|
||||
Version=3
|
||||
ViewMode=1
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
[Dolphin]
|
||||
Timestamp=2015,3,23,11,37,14
|
||||
Version=3
|
||||
ViewMode=1
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(WFR-lib_boost CXX)
|
||||
|
||||
|
||||
# cmake options
|
||||
OPTION(USE_BUILDIN_BOOST "Use buildin boost" ON)
|
||||
|
||||
|
||||
# Check whether we are called by another script
|
||||
get_directory_property(hasParent PARENT_DIRECTORY)
|
||||
|
||||
# Let's build our own copy of boost
|
||||
if (USE_BUILDIN_BOOST)
|
||||
include(ExternalProject)
|
||||
|
||||
# Set boost version
|
||||
if(hasParent)
|
||||
set(boost_version "1.57.0" PARENT_SCOPE)
|
||||
set(boost_version "1.57.0")
|
||||
else()
|
||||
set(boost_version "1.57.0")
|
||||
endif()
|
||||
|
||||
# How to build boost
|
||||
ExternalProject_Add(Boost
|
||||
DEPENDS
|
||||
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/boost/src/boost-${boost_version}
|
||||
DOWNLOAD_COMMAND mkdir -p boost-${boost_version} && tar xf ${CMAKE_CURRENT_SOURCE_DIR}/boost-${boost_version}.tar.gz --strip=1 -C boost-${boost_version}
|
||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/boost
|
||||
CONFIGURE_COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/boost/src/boost-${boost_version} && ./bootstrap.sh --with-libraries=system,filesystem,program_options --prefix=${CMAKE_CURRENT_BINARY_DIR}/boost/install --libdir=${CMAKE_CURRENT_BINARY_DIR}/boost/install/lib
|
||||
BUILD_COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/boost/src/boost-${boost_version} && ./b2 install
|
||||
INSTALL_COMMAND echo ""
|
||||
)
|
||||
|
||||
# Where to install boost
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost/install/include DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost/install/lib DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
# Provide some variables to parent script
|
||||
if(hasParent)
|
||||
set(Boost_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/boost/install/include")
|
||||
set(Boost_INCLUDE_DIR "${Boost_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Boost_INCLUDE_DIRS "${Boost_INCLUDE_DIR}")
|
||||
set(Boost_INCLUDE_DIRS "${Boost_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||
set(Boost_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/boost/install/lib")
|
||||
set(Boost_LIBRARY_DIR "${Boost_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIR}")
|
||||
set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}" PARENT_SCOPE)
|
||||
set(Boost_LIBRARIES
|
||||
"${Boost_LIBRARY_DIR}/libboost_system.so"
|
||||
"${Boost_LIBRARY_DIR}/libboost_filesystem.so"
|
||||
"${Boost_LIBRARY_DIR}/libboost_program_options.so"
|
||||
)
|
||||
set(Boost_LIBRARIES "${Boost_LIBRARIES}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
|
||||
# Let's use an existing copy of boost
|
||||
else()
|
||||
add_custom_target(Boost) # Dummy target for add_dependencies
|
||||
find_package(Boost COMPONENTS system filesystem program_options REQUIRED)
|
||||
if(hasParent)
|
||||
set(Boost_INCLUDE_DIR "${Boost_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Boost_INCLUDE_DIRS "${Boost_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||
set(Boost_LIBRARY_DIR "${Boost_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}" PARENT_SCOPE)
|
||||
set(Boost_LIBRARIES "${Boost_LIBRARIES}" PARENT_SCOPE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
|
||||
BIN
Binary file not shown.
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
add_subdirectory(third-party/boost)
|
||||
add_subdirectory(third-party/odb)
|
||||
add_subdirectory(third-party/rapidjson)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
[Dolphin]
|
||||
Timestamp=2015,3,20,14,7,57
|
||||
Version=3
|
||||
ViewMode=1
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(WFR-lib_odb CXX)
|
||||
|
||||
|
||||
# cmake options
|
||||
OPTION(USE_BUILDIN_ODB "Use buildin odb" ON)
|
||||
|
||||
|
||||
# Check whether we are called by another script
|
||||
get_directory_property(hasParent PARENT_DIRECTORY)
|
||||
|
||||
# Include libsqlite3
|
||||
add_subdirectory(sqlite3)
|
||||
# Provide some variables to parent script
|
||||
if(hasParent)
|
||||
set(Sqlite3_INCLUDE_DIR "${Sqlite3_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Sqlite3_LIBRARY_DIR "${Sqlite3_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Sqlite3_LIBRARIES "${Sqlite3_LIBRARIES}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Let's build our own copy of odb
|
||||
if (USE_BUILDIN_ODB)
|
||||
include(ExternalProject)
|
||||
|
||||
# Set odb version
|
||||
if(hasParent)
|
||||
set(odb_version "2.4.0" PARENT_SCOPE)
|
||||
set(odb_version "2.4.0")
|
||||
else()
|
||||
set(odb_version "2.4.0")
|
||||
endif()
|
||||
|
||||
set(libodb_common_CPPFLAGS "")
|
||||
set(libodb_common_CPPFLAGS "")
|
||||
set(libodb_common_DEPENDS "")
|
||||
set(libodb_common_include "-I${CMAKE_CURRENT_BINARY_DIR}/libodb_common/install/include")
|
||||
set(libodb_common_lib "-L${CMAKE_CURRENT_BINARY_DIR}/libodb_common/install/lib")
|
||||
|
||||
set(libodb_sqlite_CPPFLAGS "${libodb_common_include} -I${Sqlite3_INCLUDE_DIR}")
|
||||
set(libodb_sqlite_LDFLAGS "${libodb_common_lib} -L${Sqlite3_LIBRARY_DIR}")
|
||||
set(libodb_sqlite_DEPENDS "libodb_common")
|
||||
set(libodb_sqlite_include "-I${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite/install/include -I${Sqlite3_INCLUDE_DIR}")
|
||||
set(libodb_sqlite_lib "-L${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite/install/lib")
|
||||
|
||||
set(libodb_sqlite_DEPENDS ${libodb_sqlite_DEPENDS} sqlite3)
|
||||
|
||||
# How to build libodb-common
|
||||
ExternalProject_Add(libodb_common
|
||||
DEPENDS ${libodb_common_DEPENDS}
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libodb-${odb_version}
|
||||
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/libodb-${odb_version}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/libodb_common/install --libdir=${CMAKE_CURRENT_BINARY_DIR}/libodb_common/install/lib "CPPFLAGS=${libodb_common_CPPFLAGS}" "LDFLAGS=${libodb_common_LDFLAGS}"
|
||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libodb_common
|
||||
BUILD_COMMAND make install
|
||||
)
|
||||
|
||||
# How to build libodb-sqlite
|
||||
ExternalProject_Add(libodb_sqlite
|
||||
DEPENDS ${libodb_sqlite_DEPENDS}
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libodb-sqlite-${odb_version}
|
||||
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/libodb-sqlite-${odb_version}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite/install --libdir=${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite/install/lib "CPPFLAGS=${libodb_sqlite_CPPFLAGS}" "LDFLAGS=${libodb_sqlite_LDFLAGS}" LIBS=-ldl
|
||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite
|
||||
BUILD_COMMAND make install
|
||||
)
|
||||
|
||||
# Where to install odb
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libodb_common/install/include DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libodb_common/install/lib DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite/install/include DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite/install/lib DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/odb-${odb_version}-x86_64-linux-gnu/ USE_SOURCE_PERMISSIONS DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/odb-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
# Provide some variables to parent script
|
||||
if(hasParent)
|
||||
set(Odb_Bin "${CMAKE_CURRENT_SOURCE_DIR}/odb-${odb_version}-x86_64-linux-gnu/bin/odb")
|
||||
set(Odb_Bin "${Odb_Bin}" PARENT_SCOPE)
|
||||
set(Libodb_common_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libodb_common/install/include")
|
||||
set(Libodb_common_INCLUDE_DIR "${Libodb_common_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_common_INCLUDE_DIRS "${Libodb_common_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_common_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/libodb_common/install/lib")
|
||||
set(Libodb_common_LIBRARY_DIR "${Libodb_common_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_common_LIBRARY_DIRS "${Libodb_common_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_common_LIBRARIES "${Libodb_common_LIBRARY_DIR}/libodb.a" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite/install/include")
|
||||
set(Libodb_sqlite_INCLUDE_DIR "${Libodb_sqlite_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_INCLUDE_DIRS "${Libodb_sqlite_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/libodb_sqlite/install/lib")
|
||||
set(Libodb_sqlite_LIBRARY_DIR "${Libodb_sqlite_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_LIBRARY_DIRS "${Libodb_sqlite_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_LIBRARIES "${Libodb_sqlite_LIBRARY_DIR}/libodb-sqlite.a" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
add_custom_target(libodb) # Dummy target for add_dependencies
|
||||
add_dependencies(libodb libodb_common libodb_sqlite)
|
||||
|
||||
|
||||
# Let's use an existing copy of odb
|
||||
else()
|
||||
add_custom_target(libodb) # Dummy target for add_dependencies
|
||||
find_package(ODB REQUIRED)
|
||||
if(hasParent)
|
||||
set(ODB_INCLUDE_DIR "${ODB_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(ODB_LIBRARY_DIR "${ODB_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(ODB_LIBRARIES "${ODB_LIBRARIES}" PARENT_SCOPE)
|
||||
set(Libodb_common_INCLUDE_DIR "${ODB_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_common_INCLUDE_DIRS "${Libodb_common_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_common_LIBRARY_DIR "${ODB_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_common_LIBRARY_DIRS "${Libodb_common_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_common_LIBRARIES "${Libodb_common_LIBRARIES}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_INCLUDE_DIR "${ODB_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_INCLUDE_DIRS "${Libodb_sqlite_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_LIBRARY_DIR "${ODB_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_LIBRARY_DIRS "${Libodb_sqlite_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
set(Libodb_sqlite_LIBRARIES "${Libodb_sqlite_LIBRARIES}" PARENT_SCOPE)
|
||||
set(Odb_Bin "${Odb_Bin}" PARENT_SCOPE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
|
||||
set(SELF_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Where to find ODB
|
||||
if (NOT ODB_DIR)
|
||||
set(ODB_DIR "${SELF_DIR}")
|
||||
endif()
|
||||
|
||||
set(Libodb_common_INCLUDE_DIR "${ODB_DIR}/include")
|
||||
set(Libodb_common_LIBRARY_DIR "${ODB_DIR}/lib")
|
||||
set(Libodb_common_LIBRARIES "${ODB_DIR}/lib/libodb.a")
|
||||
set(Libodb_sqlite_INCLUDE_DIR "${ODB_DIR}/include")
|
||||
set(Libodb_sqlite_LIBRARY_DIR "${ODB_DIR}/lib")
|
||||
set(Libodb_sqlite_LIBRARIES "${ODB_DIR}/lib/libodb-sqlite.a")
|
||||
|
||||
set(ODB_INCLUDE_DIR "${ODB_DIR}/include")
|
||||
set(ODB_LIBRARY_DIR "${ODB_DIR}/lib")
|
||||
set(ODB_LIBRARIES "${ODB_DIR}/lib/libodb.a" "${ODB_DIR}/lib/libodb-sqlite.a")
|
||||
|
||||
set(Odb_Bin "${ODB_DIR}/bin/odb")
|
||||
+340
@@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
Building on UNIX
|
||||
================
|
||||
|
||||
The following build instructions are for the Linux/UNIX/Mac OS X
|
||||
operating systems as well as for Cygwin and MinGW on Windows.
|
||||
|
||||
The standard autotools-based build system is used on these platforms. After
|
||||
unpacking the source code archive, change to the libodb package directory
|
||||
(referred to as libodb/ from now on) and run the configure script:
|
||||
|
||||
./configure
|
||||
|
||||
To see the available configuration options run configure with --help:
|
||||
|
||||
./configure --help
|
||||
|
||||
As an example, the following configure command only builds shared libraries,
|
||||
uses the specified C++ compiler, and compiles with optimization and without
|
||||
debug information:
|
||||
|
||||
./configure --disable-static CXX=g++-4.5 CXXFLAGS=-O3
|
||||
|
||||
Once configuration is complete, run make to build libodb:
|
||||
|
||||
make
|
||||
|
||||
Once the build is completed successfully, you can install the libodb headers
|
||||
and libraries using the install target (you may need to do this step as root
|
||||
depending on the installation directory):
|
||||
|
||||
make install
|
||||
|
||||
|
||||
Building on Windows
|
||||
===================
|
||||
|
||||
The following build instructions are for Windows using Microsoft Visual
|
||||
Studio. If you would like to build libodb with GCC either using Cygwin
|
||||
or MinGW, refer to the "Building on UNIX" section above.
|
||||
|
||||
The standard Visual Studio project and solution files are used on this
|
||||
platform. To build libodb, unpack the source code archive and open the
|
||||
libodb-vc<N>.sln file located in the libodb package directory (referred
|
||||
to as libodb\ from now on). Here <N> is the version of Visual Studio that
|
||||
you are using. Once the solution is open, select the desired build
|
||||
configuration (Debug or Release) and platform (Win32 or x64) and build
|
||||
the solution.
|
||||
|
||||
The resulting 32-bit DLLs and import libraries are placed into the
|
||||
libodb\bin\ and libodb\lib\ directories, respectively. Similarly, the
|
||||
64-bit DLLs and import libraries are placed into libodb\bin64\ and
|
||||
libodb\lib64\. The Release versions of the import libraries are named
|
||||
odb.lib and the Debug versions are named odb-d.lib.
|
||||
|
||||
To configure Visual Studio to automatically locate the libodb headers,
|
||||
DLLs, and import libraries, add the following paths to your VC++
|
||||
Directories:
|
||||
|
||||
Win32:
|
||||
|
||||
Include: ...\libodb
|
||||
Library: ...\libodb\lib
|
||||
Executable: ...\libodb\bin
|
||||
|
||||
x64:
|
||||
|
||||
Include: ...\libodb
|
||||
Library: ...\libodb\lib64
|
||||
Executable: ...\libodb\bin64
|
||||
|
||||
Note also that by default libodb uses the __declspec(thread) storage-class
|
||||
modifier for TLS support. This mechanism is known not to work correctly on
|
||||
Windows XP/Server 2003 and earlier versions of Windows if a DLL that uses
|
||||
this modifier is loaded dynamically. If you are planning to link libodb to a
|
||||
DLL that will be loaded dynamically (e.g., delay loading, COM DLL, explicit
|
||||
LoadLibrary() call, etc), then you will need to comment out the definition
|
||||
of the ODB_THREADS_TLS_DECLSPEC macro in the odb\details\config-vc.h file
|
||||
prior to building libodb. On the other hand, if you plan to link libodb
|
||||
directly to an executable or another DLL that will be linked directly to
|
||||
an executable or if you only need to support Windows Vista/Server 2008,
|
||||
then you don't need to make this change.
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
For more information on ODB licensing as well as for answers to
|
||||
some of the common licensing questions, visit the ODB License
|
||||
page:
|
||||
|
||||
http://www.codesynthesis.com/products/odb/license.xhtml
|
||||
|
||||
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 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 St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
# file : Makefile.am
|
||||
# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
# license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
SUBDIRS = odb
|
||||
dist_doc_DATA = GPLv2 LICENSE README NEWS version
|
||||
EXTRA_DIST = INSTALL libodb-vc8.sln libodb-vc9.sln libodb-vc10.sln libodb-vc11.sln libodb-vc12.sln bootstrap
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
pkgconfig_DATA= libodb.pc
|
||||
+859
@@ -0,0 +1,859 @@
|
||||
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 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@
|
||||
|
||||
# file : Makefile.am
|
||||
# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
# license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
|
||||
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/libodb.pc.in $(top_srcdir)/config/ar-lib \
|
||||
$(top_srcdir)/config/config.guess \
|
||||
$(top_srcdir)/config/config.sub \
|
||||
$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
|
||||
$(top_srcdir)/config/missing $(top_srcdir)/configure \
|
||||
$(top_srcdir)/odb/details/config.h.in INSTALL NEWS \
|
||||
config/ar-lib config/config.guess config/config.sub \
|
||||
config/install-sh config/ltmain.sh config/missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/acx-pthread.m4 \
|
||||
$(top_srcdir)/m4/disable-rpath.m4 \
|
||||
$(top_srcdir)/m4/libtool-link.m4 $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/pkgconfig.m4 $(top_srcdir)/m4/static-lib.m4 \
|
||||
$(top_srcdir)/m4/threads.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/odb/config.h \
|
||||
$(top_builddir)/odb/details/config.h
|
||||
CONFIG_CLEAN_FILES = libodb.pc
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"
|
||||
DATA = $(dist_doc_DATA) $(pkgconfig_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
cscope distdir dist dist-all distcheck
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
if test -d "$(distdir)"; then \
|
||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__post_remove_distdir = $(am__remove_distdir)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).zip
|
||||
GZIP_ENV = --best
|
||||
DIST_TARGETS = dist-bzip2 dist-gzip dist-zip
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PTHREAD_CXX = @PTHREAD_CXX@
|
||||
PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@
|
||||
PTHREAD_LIBS = @PTHREAD_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
acx_pthread_config = @acx_pthread_config@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SUBDIRS = odb
|
||||
dist_doc_DATA = GPLv2 LICENSE README NEWS version
|
||||
EXTRA_DIST = INSTALL libodb-vc8.sln libodb-vc9.sln libodb-vc10.sln libodb-vc11.sln libodb-vc12.sln bootstrap
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
pkgconfig_DATA = libodb.pc
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
$(am__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)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
odb/details/config.h: odb/details/stamp-h2
|
||||
@if test ! -f $@; then rm -f odb/details/stamp-h2; else :; fi
|
||||
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) odb/details/stamp-h2; else :; fi
|
||||
|
||||
odb/details/stamp-h2: $(top_srcdir)/odb/details/config.h.in $(top_builddir)/config.status
|
||||
@rm -f odb/details/stamp-h2
|
||||
cd $(top_builddir) && $(SHELL) ./config.status odb/details/config.h
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f odb/details/config.h odb/details/stamp-h2
|
||||
libodb.pc: $(top_builddir)/config.status $(srcdir)/libodb.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool config.lt
|
||||
install-dist_docDATA: $(dist_doc_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-dist_docDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
cscopelist-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
|
||||
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; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
cscope: cscope.files
|
||||
test ! -s cscope.files \
|
||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
||||
|
||||
clean-cscope:
|
||||
-rm -f cscope.files
|
||||
|
||||
cscope.files: clean-cscope cscopelist-recursive cscopelist
|
||||
|
||||
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__post_remove_distdir)
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__post_remove_distdir)
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist dist-all:
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir)
|
||||
chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(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 \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__post_remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@test -n '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: trying to run $@ with an empty' \
|
||||
'$$(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA)
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-dist_docDATA install-pkgconfigDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-dist_docDATA uninstall-pkgconfigDATA
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
|
||||
cscopelist-recursive ctags-recursive install-am install-strip \
|
||||
tags-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-cscope \
|
||||
clean-generic clean-libtool cscope cscopelist \
|
||||
cscopelist-recursive ctags ctags-recursive dist dist-all \
|
||||
dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
|
||||
dist-zip distcheck distclean distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am \
|
||||
install-dist_docDATA install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-pkgconfigDATA install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs installdirs-am \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-dist_docDATA uninstall-pkgconfigDATA
|
||||
|
||||
|
||||
# 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:
|
||||
+1
@@ -0,0 +1 @@
|
||||
See the common NEWS file in the ODB compiler package.
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
ODB is an object-relational mapping (ORM) system for C++. It provides
|
||||
tools, APIs, and library support that allow you to persist C++ objects
|
||||
to a relational database (RDBMS) without having to deal with tables,
|
||||
columns, or SQL and without manually writing any of the mapping code.
|
||||
For more information see:
|
||||
|
||||
http://www.codesynthesis.com/products/odb/
|
||||
|
||||
This package contains the common ODB runtime library. Every application
|
||||
that includes code generated by the ODB compiler will need to link to
|
||||
this library.
|
||||
|
||||
See the NEWS file for the user-visible changes from the previous release.
|
||||
|
||||
See the LICENSE file for distribution conditions.
|
||||
|
||||
See the INSTALL file for prerequisites and installation instructions.
|
||||
|
||||
Send questions, bug reports, or any other feedback to the
|
||||
odb-users@codesynthesis.com mailing list.
|
||||
+1031
File diff suppressed because it is too large
Load Diff
+17
@@ -0,0 +1,17 @@
|
||||
#! /bin/sh
|
||||
|
||||
# file : bootstrap
|
||||
# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
# license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#
|
||||
# Bootstrap the automake build system.
|
||||
#
|
||||
|
||||
rm -f config.cache
|
||||
|
||||
if test ! -d m4; then
|
||||
mkdir m4
|
||||
fi
|
||||
|
||||
autoreconf --install
|
||||
+270
@@ -0,0 +1,270 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for Microsoft lib.exe
|
||||
|
||||
me=ar-lib
|
||||
scriptversion=2012-03-01.08; # UTC
|
||||
|
||||
# Copyright (C) 2010-2012 Free Software Foundation, Inc.
|
||||
# Written by Peter Rosin <peda@lysator.liu.se>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
|
||||
# func_error message
|
||||
func_error ()
|
||||
{
|
||||
echo "$me: $1" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv in
|
||||
mingw)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_at_file at_file operation archive
|
||||
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
|
||||
# for each of them.
|
||||
# When interpreting the content of the @FILE, do NOT use func_file_conv,
|
||||
# since the user would need to supply preconverted file names to
|
||||
# binutils ar, at least for MinGW.
|
||||
func_at_file ()
|
||||
{
|
||||
operation=$2
|
||||
archive=$3
|
||||
at_file_contents=`cat "$1"`
|
||||
eval set x "$at_file_contents"
|
||||
shift
|
||||
|
||||
for member
|
||||
do
|
||||
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
|
||||
done
|
||||
}
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
func_error "no command. Try '$0 --help' for more information."
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<EOF
|
||||
Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
|
||||
|
||||
Members may be specified in a file named with @FILE.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "$me, version $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test $# -lt 3; then
|
||||
func_error "you must specify a program, an action and an archive"
|
||||
fi
|
||||
|
||||
AR=$1
|
||||
shift
|
||||
while :
|
||||
do
|
||||
if test $# -lt 2; then
|
||||
func_error "you must specify a program, an action and an archive"
|
||||
fi
|
||||
case $1 in
|
||||
-lib | -LIB \
|
||||
| -ltcg | -LTCG \
|
||||
| -machine* | -MACHINE* \
|
||||
| -subsystem* | -SUBSYSTEM* \
|
||||
| -verbose | -VERBOSE \
|
||||
| -wx* | -WX* )
|
||||
AR="$AR $1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
action=$1
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
orig_archive=$1
|
||||
shift
|
||||
func_file_conv "$orig_archive"
|
||||
archive=$file
|
||||
|
||||
# strip leading dash in $action
|
||||
action=${action#-}
|
||||
|
||||
delete=
|
||||
extract=
|
||||
list=
|
||||
quick=
|
||||
replace=
|
||||
index=
|
||||
create=
|
||||
|
||||
while test -n "$action"
|
||||
do
|
||||
case $action in
|
||||
d*) delete=yes ;;
|
||||
x*) extract=yes ;;
|
||||
t*) list=yes ;;
|
||||
q*) quick=yes ;;
|
||||
r*) replace=yes ;;
|
||||
s*) index=yes ;;
|
||||
S*) ;; # the index is always updated implicitly
|
||||
c*) create=yes ;;
|
||||
u*) ;; # TODO: don't ignore the update modifier
|
||||
v*) ;; # TODO: don't ignore the verbose modifier
|
||||
*)
|
||||
func_error "unknown action specified"
|
||||
;;
|
||||
esac
|
||||
action=${action#?}
|
||||
done
|
||||
|
||||
case $delete$extract$list$quick$replace,$index in
|
||||
yes,* | ,yes)
|
||||
;;
|
||||
yesyes*)
|
||||
func_error "more than one action specified"
|
||||
;;
|
||||
*)
|
||||
func_error "no action specified"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -n "$delete"; then
|
||||
if test ! -f "$orig_archive"; then
|
||||
func_error "archive not found"
|
||||
fi
|
||||
for member
|
||||
do
|
||||
case $1 in
|
||||
@*)
|
||||
func_at_file "${1#@}" -REMOVE "$archive"
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$1"
|
||||
$AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
elif test -n "$extract"; then
|
||||
if test ! -f "$orig_archive"; then
|
||||
func_error "archive not found"
|
||||
fi
|
||||
if test $# -gt 0; then
|
||||
for member
|
||||
do
|
||||
case $1 in
|
||||
@*)
|
||||
func_at_file "${1#@}" -EXTRACT "$archive"
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$1"
|
||||
$AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
|
||||
;;
|
||||
esac
|
||||
done
|
||||
else
|
||||
$AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
|
||||
do
|
||||
$AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
|
||||
done
|
||||
fi
|
||||
|
||||
elif test -n "$quick$replace"; then
|
||||
if test ! -f "$orig_archive"; then
|
||||
if test -z "$create"; then
|
||||
echo "$me: creating $orig_archive"
|
||||
fi
|
||||
orig_archive=
|
||||
else
|
||||
orig_archive=$archive
|
||||
fi
|
||||
|
||||
for member
|
||||
do
|
||||
case $1 in
|
||||
@*)
|
||||
func_file_conv "${1#@}"
|
||||
set x "$@" "@$file"
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$1"
|
||||
set x "$@" "$file"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
shift
|
||||
done
|
||||
|
||||
if test -n "$orig_archive"; then
|
||||
$AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
|
||||
else
|
||||
$AR -NOLOGO -OUT:"$archive" "$@" || exit $?
|
||||
fi
|
||||
|
||||
elif test -n "$list"; then
|
||||
if test ! -f "$orig_archive"; then
|
||||
func_error "archive not found"
|
||||
fi
|
||||
$AR -NOLOGO -LIST "$archive" || exit $?
|
||||
fi
|
||||
+1420
File diff suppressed because it is too large
Load Diff
+1799
File diff suppressed because it is too large
Load Diff
+787
@@ -0,0 +1,787 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2012-07-12.20; # UTC
|
||||
|
||||
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# 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 outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interferences from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -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 ' ' "$nl" < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
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 ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
# 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"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
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
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# '$object: dependent.h' and one to simply 'dependent.h:'.
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
|
||||
# However on
|
||||
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\':
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
# tcc 0.9.26 (FIXME still under development at the moment of writing)
|
||||
# will emit a similar output, but also prepend the continuation lines
|
||||
# with horizontal tabulation characters.
|
||||
"$@" -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 -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
|
||||
< "$tmpdepfile" > "$depfile"
|
||||
sed '
|
||||
s/[ '"$tab"'][ '"$tab"']*/ /g
|
||||
s/^ *//
|
||||
s/ *\\*$//
|
||||
s/^[^:]*: *//
|
||||
/^$/d
|
||||
/:$/d
|
||||
s/$/ :/
|
||||
' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'`
|
||||
tmpdepfile="$base.d"
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir="$base.d-lock"
|
||||
trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0 ; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir $lockdir 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rm -rf $lockdir
|
||||
break
|
||||
else
|
||||
## the lock is being held by a different process,
|
||||
## wait until the winning process is done or we timeout
|
||||
while test -d $lockdir && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
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
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
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"
|
||||
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test "$stat" = 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' "$nl" < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no eat=no
|
||||
for arg
|
||||
do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
if test $eat = yes; then
|
||||
eat=no
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-arch)
|
||||
eat=yes ;;
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvcmsys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+527
@@ -0,0 +1,527 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2011-11-20.07; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+9661
File diff suppressed because it is too large
Load Diff
+330
@@ -0,0 +1,330 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2012-01-06.18; # UTC
|
||||
|
||||
# Copyright (C) 1996-2012 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# 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=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, 'missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-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'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all 'Makefile.in' files
|
||||
bison create 'y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create 'lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create 'lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
yacc create 'y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
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
|
||||
|
||||
# normalize program name to check for.
|
||||
program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program). This is about non-GNU programs, so use $1 not
|
||||
# $program.
|
||||
case $1 in
|
||||
lex*|yacc*)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
*)
|
||||
if 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 $program in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is $msg. You should only need it if
|
||||
you modified 'acinclude.m4' or '${configure_ac}'. You might want
|
||||
to install the Automake and Perl packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is $msg. You should only need it if
|
||||
you modified '${configure_ac}'. You might want to install the
|
||||
Autoconf and GNU m4 packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is $msg. You should only need it if
|
||||
you modified 'acconfig.h' or '${configure_ac}'. You might want
|
||||
to install the Autoconf and GNU m4 packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is $msg. You should only need it if
|
||||
you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
|
||||
You might want to install the Automake and Perl packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get '$1' as part of Autoconf from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison*|yacc*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' $msg. You should only need it if
|
||||
you modified a '.y' file. You may need the Bison package
|
||||
in order for those modifications to take effect. You can get
|
||||
Bison from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG=\${$#}
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex*|flex*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is $msg. You should only need it if
|
||||
you modified a '.l' file. You may need the Flex package
|
||||
in order for those modifications to take effect. You can get
|
||||
Flex from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG=\${$#}
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
Help2man package in order for those modifications to take
|
||||
effect. You can get Help2man from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is $msg. You should only need it if
|
||||
you modified a '.texi' or '.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy 'make' (AIX,
|
||||
DU, IRIX). You might want to install the Texinfo package or
|
||||
the GNU make package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: '$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the 'README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing '$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+20342
File diff suppressed because it is too large
Load Diff
+68
@@ -0,0 +1,68 @@
|
||||
# file : configure.ac
|
||||
# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
# license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT([libodb], [2.4.0], [odb-users@codesynthesis.com])
|
||||
AC_CONFIG_AUX_DIR([config])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_SRCDIR([odb/version.hxx])
|
||||
|
||||
AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar])
|
||||
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12.
|
||||
|
||||
LT_INIT([win32-dll])
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
# Check for C++ compiler and use it to compile the tests.
|
||||
#
|
||||
AC_PROG_CXX
|
||||
AC_LANG(C++)
|
||||
|
||||
# Create the libtool executable so that we can use it in further tests.
|
||||
#
|
||||
LT_OUTPUT
|
||||
|
||||
# Check for Windows.
|
||||
#
|
||||
win32=no
|
||||
case $host_os in
|
||||
windows* | mingw*)
|
||||
win32=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL([ODB_WIN32], [test x$win32 = xyes])
|
||||
|
||||
# Check for threads.
|
||||
#
|
||||
THREADS
|
||||
|
||||
AM_CONDITIONAL([ODB_THREADS_NONE], [test x$threads = xnone])
|
||||
AM_CONDITIONAL([ODB_THREADS_WIN32], [test x$threads = xwin32])
|
||||
AM_CONDITIONAL([ODB_THREADS_POSIX], [test x$threads = xposix])
|
||||
|
||||
AS_IF([test x$threads = xnone], AC_DEFINE([ODB_THREADS_NONE], [1], [Have no threads.]))
|
||||
AS_IF([test x$threads = xwin32], AC_DEFINE([ODB_THREADS_WIN32], [1], [Have Win32 threads.]))
|
||||
AS_IF([test x$threads = xposix], AC_DEFINE([ODB_THREADS_POSIX], [1], [Have POSIX threads.]))
|
||||
|
||||
AS_IF([test x$threads_thread_keyword = xyes], AC_DEFINE([ODB_THREADS_TLS_KEYWORD], [1], [Have __thread keyword.]))
|
||||
|
||||
# Define LIBODB_STATIC_LIB if we are build static library on certain platforms.
|
||||
#
|
||||
STATIC_LIB([LIBODB_STATIC_LIB], [Static library interface.])
|
||||
|
||||
# Allow the user to specify the pkgconfig directory.
|
||||
#
|
||||
PKGCONFIG
|
||||
|
||||
# Check if we should disable rpath.
|
||||
#
|
||||
DISABLE_RPATH
|
||||
|
||||
# Output.
|
||||
#
|
||||
AC_CONFIG_HEADERS([odb/config.h odb/details/config.h])
|
||||
AC_CONFIG_FILES([libodb.pc Makefile odb/Makefile])
|
||||
AC_OUTPUT
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb", "odb\libodb-vc10.vcxproj", "{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|x64.Build.0 = Debug|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|Win32.Build.0 = Release|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|x64.ActiveCfg = Release|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb", "odb\libodb-vc11.vcxproj", "{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|x64.Build.0 = Debug|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|Win32.Build.0 = Release|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|x64.ActiveCfg = Release|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb", "odb\libodb-vc12.vcxproj", "{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Debug|x64.Build.0 = Debug|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|Win32.Build.0 = Release|Win32
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|x64.ActiveCfg = Release|x64
|
||||
{1C53C543-8038-4C8A-8AB1-65E74FD7DE2E}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb", "odb\libodb-vc8.vcproj", "{513E5721-D318-46B0-8CFB-054042DF87A7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Debug|x64.Build.0 = Debug|x64
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Release|Win32.Build.0 = Release|Win32
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Release|x64.ActiveCfg = Release|x64
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb", "odb\libodb-vc9.vcproj", "{513E5721-D318-46B0-8CFB-054042DF87A7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Debug|x64.Build.0 = Debug|x64
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Release|Win32.Build.0 = Release|Win32
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Release|x64.ActiveCfg = Release|x64
|
||||
{513E5721-D318-46B0-8CFB-054042DF87A7}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# file : libodb.pc.in
|
||||
# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
# license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libodb
|
||||
Description: Object-relational mapping (ORM) system for C++, common runtime library
|
||||
URL: http://www.codesynthesis.com/products/odb/
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lodb
|
||||
Cflags: -I${includedir}
|
||||
+259
@@ -0,0 +1,259 @@
|
||||
dnl
|
||||
dnl NOTE: This file was modified. See the comments starting with 'CS:'
|
||||
dnl for more information. In particular, it was changed to use C++
|
||||
dnl instead of C.
|
||||
dnl
|
||||
dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
dnl
|
||||
dnl @summary figure out how to build C++ programs using POSIX threads
|
||||
dnl
|
||||
dnl This macro figures out how to build C++ programs using POSIX threads.
|
||||
dnl It sets the PTHREAD_LIBS output variable to the threads library and
|
||||
dnl linker flags, and the PTHREAD_CXXFLAGS output variable to any special
|
||||
dnl C++ compiler flags that are needed. (The user can also force certain
|
||||
dnl compiler flags/libs to be tested by setting these environment
|
||||
dnl variables.)
|
||||
dnl
|
||||
dnl Also sets PTHREAD_CXX to any special C++ compiler that is needed for
|
||||
dnl multi-threaded programs (defaults to the value of CXX otherwise).
|
||||
dnl (This is necessary on AIX to use the special xlC_r compiler alias.)
|
||||
dnl
|
||||
dnl NOTE: You are assumed to not only compile your program with these
|
||||
dnl flags, but also link it with them as well. e.g. you should link
|
||||
dnl with $PTHREAD_CXX $CXXFLAGS $PTHREAD_CXXFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
||||
dnl $LIBS
|
||||
dnl
|
||||
dnl If you are only building threads programs, you may wish to use
|
||||
dnl these variables in your default LIBS, CXXFLAGS, and CXX:
|
||||
dnl
|
||||
dnl LIBS="$PTHREAD_LIBS $LIBS"
|
||||
dnl CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS"
|
||||
dnl CXX="$PTHREAD_CXX"
|
||||
dnl
|
||||
dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
||||
dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
||||
dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
dnl
|
||||
dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
|
||||
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
||||
dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
||||
dnl default action will define HAVE_PTHREAD.
|
||||
dnl
|
||||
dnl Please let the authors know if this macro fails on any platform, or
|
||||
dnl if you have any other suggestions or comments. This macro was based
|
||||
dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
|
||||
dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
|
||||
dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
|
||||
dnl We are also grateful for the helpful feedback of numerous users.
|
||||
dnl
|
||||
dnl @category InstalledPackages
|
||||
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
dnl @version 2006-05-29
|
||||
dnl @license GPLWithACException
|
||||
|
||||
AC_DEFUN([ACX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG(C++)
|
||||
acx_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CXXFLAGS" != x; then
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CXXFLAGS=$PTHREAD_CXXFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CXXFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
# CS: On GNU/Linux with gcc both -pthread and -lpthread are valid.
|
||||
# However, libtool links libraries with -nostdlib which results in
|
||||
# -pthread being stripped from the linker command line. To resolve
|
||||
# this we move pthread from after -mthreads to after pthreads.
|
||||
#
|
||||
acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
# CS: Move -mt to the front of the list; Sun CC will use -mt,
|
||||
# gcc will use -pthreads.
|
||||
#
|
||||
acx_pthread_flags="-mt -pthreads pthread -pthread $acx_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
for flag in $acx_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CXXFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
||||
if test x"$acx_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CXXFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
#
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_t th; pthread_join(th, 0);
|
||||
pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0);],
|
||||
[acx_pthread_ok=yes])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CXXFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS"
|
||||
|
||||
dnl # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
dnl AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
dnl attr_name=unknown
|
||||
dnl for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
dnl AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
||||
dnl [attr_name=$attr; break])
|
||||
dnl done
|
||||
dnl AC_MSG_RESULT($attr_name)
|
||||
dnl if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
dnl AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
dnl [Define to necessary symbol if this constant
|
||||
dnl uses a non-standard name on your system.])
|
||||
dnl fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||
# CS: Add _REENTRANT in Linux to emulate -pthread.
|
||||
#
|
||||
*-linux* | *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CXXFLAGS="$flag $PTHREAD_CXXFLAGS"
|
||||
fi
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
|
||||
dnl # More AIX lossage: must compile with xlC_r
|
||||
dnl if test x"$GXX" != xyes; then
|
||||
dnl AC_CHECK_PROGS(PTHREAD_CXX, xlC_r, ${CXX})
|
||||
dnl else
|
||||
dnl PTHREAD_CXX=$CXX
|
||||
dnl fi
|
||||
|
||||
else
|
||||
PTHREAD_CXX="$CXX"
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CXXFLAGS)
|
||||
AC_SUBST(PTHREAD_CXX)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$acx_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
acx_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
])dnl ACX_PTHREAD
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
dnl file : m4/disable-rpath.m4
|
||||
dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
dnl license : GNU GPL v2; see accompanying LICENSE file
|
||||
dnl
|
||||
AC_DEFUN([DISABLE_RPATH],[
|
||||
|
||||
AC_MSG_CHECKING([whether to use rpath])
|
||||
AC_ARG_ENABLE(
|
||||
[rpath],
|
||||
[AC_HELP_STRING([--disable-rpath], [patch libtool to not use rpath])],
|
||||
[libtool_rpath="$enable_rpath"],
|
||||
[libtool_rpath="yes"])
|
||||
AC_MSG_RESULT($libtool_rpath)
|
||||
|
||||
# Patch libtool to not use rpath if requested.
|
||||
#
|
||||
AC_CONFIG_COMMANDS(
|
||||
[libtool-rpath-patch],
|
||||
[if test "$libtool_use_rpath" = "no"; then
|
||||
sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "/'
|
||||
mv libtool-2 libtool
|
||||
chmod 755 libtool
|
||||
fi],
|
||||
[libtool_use_rpath=$libtool_rpath])
|
||||
])dnl
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
dnl file : m4/libtool-link.m4
|
||||
dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
dnl license : GNU GPL v2; see accompanying LICENSE file
|
||||
dnl
|
||||
dnl
|
||||
dnl CXX_LIBTOOL_LINK_IFELSE (input, [action-if-true], [action-if-false])
|
||||
dnl
|
||||
dnl Similar to AC_LINK_IFELSE except it uses libtool to perform the
|
||||
dnl linking and it does this using the C++ compiler.
|
||||
dnl
|
||||
AC_DEFUN([CXX_LIBTOOL_LINK_IFELSE],[
|
||||
AC_LANG_SAVE
|
||||
AC_LANG(C++)
|
||||
|
||||
if test -d .libs; then
|
||||
delete_libs_dir=no
|
||||
else
|
||||
delete_libs_dir=yes
|
||||
fi
|
||||
|
||||
AC_COMPILE_IFELSE([$1],
|
||||
[
|
||||
ac_try='./libtool --tag=CXX --mode=link $CXX -no-install $CXXFLAGS $LDFLAGS -o conftest conftest.$OBJEXT $LIBS >&AS_MESSAGE_LOG_FD'
|
||||
if _AC_DO_VAR(ac_try); then
|
||||
libtool_link_ok=yes
|
||||
else
|
||||
libtool_link_ok=no
|
||||
fi
|
||||
],
|
||||
[
|
||||
libtool_link_ok=no
|
||||
])
|
||||
|
||||
if test x"$delete_libs_dir" = xyes; then
|
||||
rm -rf .libs
|
||||
fi
|
||||
|
||||
if test x"$libtool_link_ok" = xyes; then
|
||||
[$2]
|
||||
:
|
||||
else
|
||||
[$3]
|
||||
:
|
||||
fi
|
||||
|
||||
AC_LANG_RESTORE])dnl
|
||||
+7991
File diff suppressed because it is too large
Load Diff
+384
@@ -0,0 +1,384 @@
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7 ltoptions.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
|
||||
|
||||
|
||||
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ------------------------------------------
|
||||
m4_define([_LT_MANGLE_OPTION],
|
||||
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ---------------------------------------
|
||||
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
|
||||
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
|
||||
# saved as a flag.
|
||||
m4_define([_LT_SET_OPTION],
|
||||
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
|
||||
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
[m4_warning([Unknown $1 option `$2'])])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
|
||||
# ------------------------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
m4_define([_LT_IF_OPTION],
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
|
||||
|
||||
|
||||
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
|
||||
# -------------------------------------------------------
|
||||
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
|
||||
# are set.
|
||||
m4_define([_LT_UNLESS_OPTIONS],
|
||||
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
|
||||
[m4_define([$0_found])])])[]dnl
|
||||
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
|
||||
])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
|
||||
# ----------------------------------------
|
||||
# OPTION-LIST is a space-separated list of Libtool options associated
|
||||
# with MACRO-NAME. If any OPTION has a matching handler declared with
|
||||
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
|
||||
# the unknown option and exit.
|
||||
m4_defun([_LT_SET_OPTIONS],
|
||||
[# Set options
|
||||
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[_LT_SET_OPTION([$1], _LT_Option)])
|
||||
|
||||
m4_if([$1],[LT_INIT],[
|
||||
dnl
|
||||
dnl Simply set some default values (i.e off) if boolean options were not
|
||||
dnl specified:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
|
||||
])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
|
||||
])
|
||||
dnl
|
||||
dnl If no reference was made to various pairs of opposing options, then
|
||||
dnl we run the default mode handler for the pair. For example, if neither
|
||||
dnl `shared' nor `disable-shared' was passed, we enable building of shared
|
||||
dnl archives by default:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
])
|
||||
])# _LT_SET_OPTIONS
|
||||
|
||||
|
||||
## --------------------------------- ##
|
||||
## Macros to handle LT_INIT options. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
|
||||
# -----------------------------------------
|
||||
m4_define([_LT_MANGLE_DEFUN],
|
||||
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
|
||||
# -----------------------------------------------
|
||||
m4_define([LT_OPTION_DEFINE],
|
||||
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
|
||||
])# LT_OPTION_DEFINE
|
||||
|
||||
|
||||
# dlopen
|
||||
# ------
|
||||
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_DLOPEN],
|
||||
[_LT_SET_OPTION([LT_INIT], [dlopen])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `dlopen' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
|
||||
|
||||
|
||||
# win32-dll
|
||||
# ---------
|
||||
# Declare package support for building win32 dll's.
|
||||
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
|
||||
[enable_win32_dll=yes
|
||||
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
esac
|
||||
|
||||
test -z "$AS" && AS=as
|
||||
_LT_DECL([], [AS], [1], [Assembler program])dnl
|
||||
|
||||
test -z "$DLLTOOL" && DLLTOOL=dlltool
|
||||
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
|
||||
|
||||
test -z "$OBJDUMP" && OBJDUMP=objdump
|
||||
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
|
||||
])# win32-dll
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
_LT_SET_OPTION([LT_INIT], [win32-dll])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `win32-dll' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
|
||||
|
||||
|
||||
# _LT_ENABLE_SHARED([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-shared flag, and supports the `shared' and
|
||||
# `disable-shared' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_SHARED],
|
||||
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
|
||||
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
|
||||
|
||||
_LT_DECL([build_libtool_libs], [enable_shared], [0],
|
||||
[Whether or not to build shared libraries])
|
||||
])# _LT_ENABLE_SHARED
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-shared])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
|
||||
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_STATIC([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-static flag, and support the `static' and
|
||||
# `disable-static' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_STATIC],
|
||||
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
|
||||
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
|
||||
|
||||
_LT_DECL([build_old_libs], [enable_static], [0],
|
||||
[Whether or not to build static libraries])
|
||||
])# _LT_ENABLE_STATIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-static])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
|
||||
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --enable-fast-install flag, and support the `fast-install'
|
||||
# and `disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_FAST_INSTALL],
|
||||
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
|
||||
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
|
||||
|
||||
_LT_DECL([fast_install], [enable_fast_install], [0],
|
||||
[Whether or not to optimize for fast installation])dnl
|
||||
])# _LT_ENABLE_FAST_INSTALL
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
|
||||
|
||||
# Old names:
|
||||
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `disable-fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
||||
|
||||
|
||||
# _LT_WITH_PIC([MODE])
|
||||
# --------------------
|
||||
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
|
||||
# LT_INIT options.
|
||||
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
||||
m4_define([_LT_WITH_PIC],
|
||||
[AC_ARG_WITH([pic],
|
||||
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
|
||||
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
||||
[lt_p=${PACKAGE-default}
|
||||
case $withval in
|
||||
yes|no) pic_mode=$withval ;;
|
||||
*)
|
||||
pic_mode=default
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for lt_pkg in $withval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$lt_pkg" = "X$lt_p"; then
|
||||
pic_mode=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[pic_mode=default])
|
||||
|
||||
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
||||
|
||||
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
|
||||
])# _LT_WITH_PIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
|
||||
|
||||
# Old name:
|
||||
AU_DEFUN([AC_LIBTOOL_PICMODE],
|
||||
[_LT_SET_OPTION([LT_INIT], [pic-only])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `pic-only' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
|
||||
|
||||
## ----------------- ##
|
||||
## LTDL_INIT Options ##
|
||||
## ----------------- ##
|
||||
|
||||
m4_define([_LTDL_MODE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
|
||||
[m4_define([_LTDL_MODE], [nonrecursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
|
||||
[m4_define([_LTDL_MODE], [recursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
|
||||
[m4_define([_LTDL_MODE], [subproject])])
|
||||
|
||||
m4_define([_LTDL_TYPE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [installable],
|
||||
[m4_define([_LTDL_TYPE], [installable])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
|
||||
[m4_define([_LTDL_TYPE], [convenience])])
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6 ltsugar.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
|
||||
|
||||
|
||||
# lt_join(SEP, ARG1, [ARG2...])
|
||||
# -----------------------------
|
||||
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
|
||||
# associated separator.
|
||||
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
|
||||
# versions in m4sugar had bugs.
|
||||
m4_define([lt_join],
|
||||
[m4_if([$#], [1], [],
|
||||
[$#], [2], [[$2]],
|
||||
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
m4_define([_lt_join],
|
||||
[m4_if([$#$2], [2], [],
|
||||
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
|
||||
|
||||
# lt_car(LIST)
|
||||
# lt_cdr(LIST)
|
||||
# ------------
|
||||
# Manipulate m4 lists.
|
||||
# These macros are necessary as long as will still need to support
|
||||
# Autoconf-2.59 which quotes differently.
|
||||
m4_define([lt_car], [[$1]])
|
||||
m4_define([lt_cdr],
|
||||
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
|
||||
[$#], 1, [],
|
||||
[m4_dquote(m4_shift($@))])])
|
||||
m4_define([lt_unquote], $1)
|
||||
|
||||
|
||||
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# ------------------------------------------
|
||||
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
|
||||
# Note that neither SEPARATOR nor STRING are expanded; they are appended
|
||||
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
|
||||
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
|
||||
# than defined and empty).
|
||||
#
|
||||
# This macro is needed until we can rely on Autoconf 2.62, since earlier
|
||||
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
|
||||
m4_define([lt_append],
|
||||
[m4_define([$1],
|
||||
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
|
||||
|
||||
|
||||
|
||||
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
|
||||
# ----------------------------------------------------------
|
||||
# Produce a SEP delimited list of all paired combinations of elements of
|
||||
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
|
||||
# has the form PREFIXmINFIXSUFFIXn.
|
||||
# Needed until we can rely on m4_combine added in Autoconf 2.62.
|
||||
m4_define([lt_combine],
|
||||
[m4_if(m4_eval([$# > 3]), [1],
|
||||
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
|
||||
[[m4_foreach([_Lt_prefix], [$2],
|
||||
[m4_foreach([_Lt_suffix],
|
||||
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
|
||||
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
|
||||
|
||||
|
||||
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
|
||||
# -----------------------------------------------------------------------
|
||||
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
|
||||
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
|
||||
m4_define([lt_if_append_uniq],
|
||||
[m4_ifdef([$1],
|
||||
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
|
||||
[lt_append([$1], [$2], [$3])$4],
|
||||
[$5])],
|
||||
[lt_append([$1], [$2], [$3])$4])])
|
||||
|
||||
|
||||
# lt_dict_add(DICT, KEY, VALUE)
|
||||
# -----------------------------
|
||||
m4_define([lt_dict_add],
|
||||
[m4_define([$1($2)], [$3])])
|
||||
|
||||
|
||||
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
|
||||
# --------------------------------------------
|
||||
m4_define([lt_dict_add_subkey],
|
||||
[m4_define([$1($2:$3)], [$4])])
|
||||
|
||||
|
||||
# lt_dict_fetch(DICT, KEY, [SUBKEY])
|
||||
# ----------------------------------
|
||||
m4_define([lt_dict_fetch],
|
||||
[m4_ifval([$3],
|
||||
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
|
||||
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
|
||||
|
||||
|
||||
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
|
||||
# -----------------------------------------------------------------
|
||||
m4_define([lt_if_dict_fetch],
|
||||
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
|
||||
[$5],
|
||||
[$6])])
|
||||
|
||||
|
||||
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
|
||||
# --------------------------------------------------------------
|
||||
m4_define([lt_dict_filter],
|
||||
[m4_if([$5], [], [],
|
||||
[lt_join(m4_quote(m4_default([$4], [[, ]])),
|
||||
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
|
||||
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
|
||||
])
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# @configure_input@
|
||||
|
||||
# serial 3337 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.2])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3337])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4.2'
|
||||
macro_revision='1.3337'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5 lt~obsolete.m4
|
||||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
|
||||
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
|
||||
# using a macro with the same name in our local m4/libtool.m4 it'll
|
||||
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
|
||||
# and doesn't know about Autoconf macros at all.)
|
||||
#
|
||||
# So we provide this file, which has a silly filename so it's always
|
||||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
# we give up compatibility with versions before 1.7, at which point
|
||||
# we need to keep only those names which we still refer to.
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
|
||||
|
||||
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
|
||||
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
|
||||
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
|
||||
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
|
||||
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
|
||||
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
|
||||
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
|
||||
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
|
||||
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
|
||||
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
|
||||
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
|
||||
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
|
||||
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
|
||||
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
|
||||
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
|
||||
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
|
||||
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
|
||||
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
|
||||
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
|
||||
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
|
||||
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
|
||||
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
|
||||
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
|
||||
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
|
||||
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
|
||||
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
|
||||
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
|
||||
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
|
||||
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
|
||||
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
|
||||
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
|
||||
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
|
||||
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
|
||||
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
dnl file : m4/pkgconfig.m4
|
||||
dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
dnl license : GNU GPL v2; see accompanying LICENSE file
|
||||
dnl
|
||||
AC_DEFUN([PKGCONFIG],[
|
||||
AC_ARG_WITH(
|
||||
[pkgconfigdir],
|
||||
[AC_HELP_STRING([--with-pkgconfigdir=DIR],[location of pkgconfig dir (default is libdir/pkgconfig)])],
|
||||
[pkgconfigdir=${withval}],
|
||||
[pkgconfigdir='${libdir}/pkgconfig'])
|
||||
AC_SUBST([pkgconfigdir])
|
||||
])dnl
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
dnl file : m4/static-lib.m4
|
||||
dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
dnl license : GNU GPL v2; see accompanying LICENSE file
|
||||
dnl
|
||||
dnl STATIC_LIB(MACRO, DESCRIPTION)
|
||||
dnl
|
||||
dnl Define MACRO if we are on MinGW and are only building static library.
|
||||
dnl
|
||||
AC_DEFUN([STATIC_LIB],
|
||||
[
|
||||
if test x$enable_shared = xno; then
|
||||
case $host_os in
|
||||
mingw*)
|
||||
AC_DEFINE([$1], [1], [$2])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])dnl
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
dnl file : m4/threads.m4
|
||||
dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
dnl license : GNU GPL v2; see accompanying LICENSE file
|
||||
dnl
|
||||
AC_DEFUN([THREADS],[
|
||||
|
||||
threads_thread_keyword=no
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[threads],
|
||||
AS_HELP_STRING([--disable-threads], [disable threads (enabled by default)]),
|
||||
[AS_IF([test x"$enableval" = xno], [threads=none], [threads=check])],
|
||||
[threads=check])
|
||||
|
||||
# If thread support is not disabled by the user, figure out what we can use.
|
||||
#
|
||||
if test x$threads = xcheck; then
|
||||
case $host_os in
|
||||
windows* | mingw*)
|
||||
case $host_os in
|
||||
mingw*)
|
||||
CXXFLAGS="$CXXFLAGS -mthreads"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Newer versions of GCC can be configured to use either Win32 or POSIX
|
||||
# threads. It appears that -mthreads should be used in both cases but
|
||||
# if the model is POSIX then GCC will also link -lpthread by default.
|
||||
# Use that fact to test which model we have.
|
||||
#
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_create(0,0,0,0);],
|
||||
[threads=posix],
|
||||
[threads=win32])
|
||||
;;
|
||||
*)
|
||||
ACX_PTHREAD
|
||||
|
||||
if test x$acx_pthread_ok = xyes; then
|
||||
threads=posix
|
||||
LIBS="$LIBS $PTHREAD_LIBS"
|
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS"
|
||||
|
||||
# Check if we can use the __thread keyword.
|
||||
#
|
||||
AC_MSG_CHECKING([for __thread keyword])
|
||||
|
||||
CXX_LIBTOOL_LINK_IFELSE([
|
||||
AC_LANG_SOURCE([
|
||||
__thread int tls_var;
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
tls_var = 0;
|
||||
}
|
||||
])],
|
||||
[threads_thread_keyword=yes])
|
||||
|
||||
AC_MSG_RESULT([$threads_thread_keyword])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test x$threads = xcheck; then
|
||||
AC_MSG_ERROR([thread support not available; use --disable-threads to force single-threaded mode])
|
||||
fi
|
||||
])dnl
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
# file : odb/Makefile.am
|
||||
# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
# license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
lib_LTLIBRARIES = libodb.la
|
||||
libodb_la_SOURCES = callback.cxx exceptions.cxx database.cxx vector-impl.cxx connection.cxx lazy-ptr-impl.cxx prepared-query.cxx query-dynamic.cxx result.cxx schema-catalog.cxx section.cxx session.cxx statement.cxx statement-processing.cxx tracer.cxx transaction.cxx details/buffer.cxx details/condition.cxx details/lock.cxx details/mutex.cxx details/shared-ptr/base.cxx
|
||||
|
||||
odbincludedir = $(includedir)/odb
|
||||
nobase_odbinclude_HEADERS = std-unordered-map-traits.hxx query-dynamic.txx traits.hxx schema-catalog-impl.hxx version.hxx polymorphic-map.hxx result.hxx lazy-ptr-impl.txx schema-catalog.hxx pointer-traits.hxx std-list-traits.hxx compilers/vc/post.hxx compilers/vc/pre.hxx query-dynamic.hxx statement.hxx vector-traits.hxx object-result.hxx std-set-traits.hxx lazy-ptr.hxx vector.hxx prepared-query.hxx exception.hxx vector-impl.ixx vector.ixx std-array-traits.hxx no-op-cache-traits.hxx section.hxx no-id-object-result.txx lazy-ptr-impl.hxx container-traits.hxx view-result.hxx transaction.hxx polymorphic-object-result.txx view-image.hxx connection.ixx connection.txx std-vector-traits.hxx view-result.txx tracer.hxx database.ixx post.hxx schema-version.hxx vector-traits.txx session.ixx forward.hxx polymorphic-map.txx function-table.hxx session.hxx connection.hxx std-unordered-set-traits.hxx details/lock.hxx details/thread.hxx details/shared-ptr-fwd.hxx details/tls.hxx details/wrapper-p.hxx details/shared-ptr/base.txx details/shared-ptr/exception.hxx details/shared-ptr/counter-type.hxx details/shared-ptr/base.ixx details/shared-ptr/base.hxx details/exception.hxx details/type-info.hxx details/function-wrapper.hxx details/function-wrapper.txx details/meta/remove-volatile.hxx details/meta/class-p.hxx details/meta/remove-const.hxx details/meta/static-assert.hxx details/meta/remove-const-volatile.hxx details/meta/polymorphic-p.hxx details/meta/answer.hxx details/meta/remove-pointer.hxx details/condition.hxx details/buffer.hxx details/shared-ptr.hxx details/transfer-ptr.hxx details/mutex.hxx details/c-string.hxx details/export.hxx details/function-wrapper.ixx details/unused.hxx details/config.hxx details/unique-ptr.hxx polymorphic-map.ixx cache-traits.hxx simple-object-result.txx std-map-traits.hxx lazy-pointer-traits.hxx std-forward-list-traits.hxx lazy-ptr-impl.ixx core.hxx simple-object-result.hxx result.txx polymorphic-info.hxx database.txx tr1/pointer-traits.hxx tr1/lazy-ptr.hxx tr1/memory.hxx tr1/lazy-pointer-traits.hxx tr1/lazy-ptr.ixx tr1/wrapper-traits.hxx tr1/lazy-ptr.txx pre.hxx query-dynamic.ixx query.hxx transaction.ixx callback.hxx lazy-ptr.ixx polymorphic-object-result.hxx wrapper-traits.hxx exceptions.hxx nullable.hxx no-id-object-result.hxx session.txx lazy-ptr.txx vector-impl.hxx database.hxx std-deque-traits.hxx statement-processing-common.hxx
|
||||
nobase_nodist_odbinclude_HEADERS = details/config.h
|
||||
|
||||
EXTRA_DIST = details/config-vc.h libodb-vc8.vcproj libodb-vc9.vcproj libodb-vc10.vcxproj libodb-vc10.vcxproj.filters libodb-vc11.vcxproj libodb-vc11.vcxproj.filters libodb-vc12.vcxproj libodb-vc12.vcxproj.filters
|
||||
|
||||
# At the moment, DllMain() is only necessary if we are using Win32
|
||||
# threads. So keep win32_dll_sources in ODB_THREADS_WIN32.
|
||||
#
|
||||
if ODB_WIN32
|
||||
nobase_odbinclude_HEADERS += details/win32/windows.hxx
|
||||
endif
|
||||
|
||||
if ODB_THREADS_POSIX
|
||||
libodb_la_SOURCES += details/posix/exceptions.cxx details/posix/thread.cxx
|
||||
nobase_odbinclude_HEADERS += details/posix/thread.hxx details/posix/tls.hxx details/posix/condition.hxx details/posix/mutex.ixx details/posix/mutex.hxx details/posix/thread.ixx details/posix/tls.ixx details/posix/tls.txx details/posix/condition.ixx details/posix/exceptions.hxx
|
||||
endif
|
||||
|
||||
if ODB_THREADS_WIN32
|
||||
libodb_la_SOURCES += details/win32/init.cxx details/win32/once.cxx details/win32/tls.cxx details/win32/condition.cxx details/win32/thread.cxx details/win32/exceptions.cxx details/win32/dll.cxx
|
||||
nobase_odbinclude_HEADERS += details/win32/lock.hxx details/win32/thread.hxx details/win32/once-init.hxx details/win32/tls.hxx details/win32/condition.hxx details/win32/tls-init.hxx details/win32/mutex.ixx details/win32/mutex.hxx details/win32/once.hxx details/win32/once.ixx details/win32/tls.ixx details/win32/tls.txx details/win32/condition.ixx details/win32/init.hxx details/win32/exceptions.hxx
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS= -I'$(top_builddir)' -I'$(top_srcdir)' -DLIBODB_DYNAMIC_LIB
|
||||
AM_LDFLAGS = -release 2.4 -no-undefined
|
||||
+917
@@ -0,0 +1,917 @@
|
||||
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 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@
|
||||
|
||||
# file : odb/Makefile.am
|
||||
# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
# license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
|
||||
# At the moment, DllMain() is only necessary if we are using Win32
|
||||
# threads. So keep win32_dll_sources in ODB_THREADS_WIN32.
|
||||
#
|
||||
@ODB_WIN32_TRUE@am__append_1 = details/win32/windows.hxx
|
||||
@ODB_THREADS_POSIX_TRUE@am__append_2 = details/posix/exceptions.cxx details/posix/thread.cxx
|
||||
@ODB_THREADS_POSIX_TRUE@am__append_3 = details/posix/thread.hxx details/posix/tls.hxx details/posix/condition.hxx details/posix/mutex.ixx details/posix/mutex.hxx details/posix/thread.ixx details/posix/tls.ixx details/posix/tls.txx details/posix/condition.ixx details/posix/exceptions.hxx
|
||||
@ODB_THREADS_WIN32_TRUE@am__append_4 = details/win32/init.cxx details/win32/once.cxx details/win32/tls.cxx details/win32/condition.cxx details/win32/thread.cxx details/win32/exceptions.cxx details/win32/dll.cxx
|
||||
@ODB_THREADS_WIN32_TRUE@am__append_5 = details/win32/lock.hxx details/win32/thread.hxx details/win32/once-init.hxx details/win32/tls.hxx details/win32/condition.hxx details/win32/tls-init.hxx details/win32/mutex.ixx details/win32/mutex.hxx details/win32/once.hxx details/win32/once.ixx details/win32/tls.ixx details/win32/tls.txx details/win32/condition.ixx details/win32/init.hxx details/win32/exceptions.hxx
|
||||
subdir = odb
|
||||
DIST_COMMON = $(am__nobase_odbinclude_HEADERS_DIST) \
|
||||
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/config.h.in $(top_srcdir)/config/depcomp
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/acx-pthread.m4 \
|
||||
$(top_srcdir)/m4/disable-rpath.m4 \
|
||||
$(top_srcdir)/m4/libtool-link.m4 $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/pkgconfig.m4 $(top_srcdir)/m4/static-lib.m4 \
|
||||
$(top_srcdir)/m4/threads.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h $(top_builddir)/odb/details/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(odbincludedir)" \
|
||||
"$(DESTDIR)$(odbincludedir)"
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libodb_la_LIBADD =
|
||||
am__libodb_la_SOURCES_DIST = callback.cxx exceptions.cxx database.cxx \
|
||||
vector-impl.cxx connection.cxx lazy-ptr-impl.cxx \
|
||||
prepared-query.cxx query-dynamic.cxx result.cxx \
|
||||
schema-catalog.cxx section.cxx session.cxx statement.cxx \
|
||||
statement-processing.cxx tracer.cxx transaction.cxx \
|
||||
details/buffer.cxx details/condition.cxx details/lock.cxx \
|
||||
details/mutex.cxx details/shared-ptr/base.cxx \
|
||||
details/posix/exceptions.cxx details/posix/thread.cxx \
|
||||
details/win32/init.cxx details/win32/once.cxx \
|
||||
details/win32/tls.cxx details/win32/condition.cxx \
|
||||
details/win32/thread.cxx details/win32/exceptions.cxx \
|
||||
details/win32/dll.cxx
|
||||
am__dirstamp = $(am__leading_dot)dirstamp
|
||||
@ODB_THREADS_POSIX_TRUE@am__objects_1 = details/posix/exceptions.lo \
|
||||
@ODB_THREADS_POSIX_TRUE@ details/posix/thread.lo
|
||||
@ODB_THREADS_WIN32_TRUE@am__objects_2 = details/win32/init.lo \
|
||||
@ODB_THREADS_WIN32_TRUE@ details/win32/once.lo \
|
||||
@ODB_THREADS_WIN32_TRUE@ details/win32/tls.lo \
|
||||
@ODB_THREADS_WIN32_TRUE@ details/win32/condition.lo \
|
||||
@ODB_THREADS_WIN32_TRUE@ details/win32/thread.lo \
|
||||
@ODB_THREADS_WIN32_TRUE@ details/win32/exceptions.lo \
|
||||
@ODB_THREADS_WIN32_TRUE@ details/win32/dll.lo
|
||||
am_libodb_la_OBJECTS = callback.lo exceptions.lo database.lo \
|
||||
vector-impl.lo connection.lo lazy-ptr-impl.lo \
|
||||
prepared-query.lo query-dynamic.lo result.lo schema-catalog.lo \
|
||||
section.lo session.lo statement.lo statement-processing.lo \
|
||||
tracer.lo transaction.lo details/buffer.lo \
|
||||
details/condition.lo details/lock.lo details/mutex.lo \
|
||||
details/shared-ptr/base.lo $(am__objects_1) $(am__objects_2)
|
||||
libodb_la_OBJECTS = $(am_libodb_la_OBJECTS)
|
||||
DEFAULT_INCLUDES =
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libodb_la_SOURCES)
|
||||
DIST_SOURCES = $(am__libodb_la_SOURCES_DIST)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__nobase_odbinclude_HEADERS_DIST = std-unordered-map-traits.hxx \
|
||||
query-dynamic.txx traits.hxx schema-catalog-impl.hxx \
|
||||
version.hxx polymorphic-map.hxx result.hxx lazy-ptr-impl.txx \
|
||||
schema-catalog.hxx pointer-traits.hxx std-list-traits.hxx \
|
||||
compilers/vc/post.hxx compilers/vc/pre.hxx query-dynamic.hxx \
|
||||
statement.hxx vector-traits.hxx object-result.hxx \
|
||||
std-set-traits.hxx lazy-ptr.hxx vector.hxx prepared-query.hxx \
|
||||
exception.hxx vector-impl.ixx vector.ixx std-array-traits.hxx \
|
||||
no-op-cache-traits.hxx section.hxx no-id-object-result.txx \
|
||||
lazy-ptr-impl.hxx container-traits.hxx view-result.hxx \
|
||||
transaction.hxx polymorphic-object-result.txx view-image.hxx \
|
||||
connection.ixx connection.txx std-vector-traits.hxx \
|
||||
view-result.txx tracer.hxx database.ixx post.hxx \
|
||||
schema-version.hxx vector-traits.txx session.ixx forward.hxx \
|
||||
polymorphic-map.txx function-table.hxx session.hxx \
|
||||
connection.hxx std-unordered-set-traits.hxx details/lock.hxx \
|
||||
details/thread.hxx details/shared-ptr-fwd.hxx details/tls.hxx \
|
||||
details/wrapper-p.hxx details/shared-ptr/base.txx \
|
||||
details/shared-ptr/exception.hxx \
|
||||
details/shared-ptr/counter-type.hxx \
|
||||
details/shared-ptr/base.ixx details/shared-ptr/base.hxx \
|
||||
details/exception.hxx details/type-info.hxx \
|
||||
details/function-wrapper.hxx details/function-wrapper.txx \
|
||||
details/meta/remove-volatile.hxx details/meta/class-p.hxx \
|
||||
details/meta/remove-const.hxx details/meta/static-assert.hxx \
|
||||
details/meta/remove-const-volatile.hxx \
|
||||
details/meta/polymorphic-p.hxx details/meta/answer.hxx \
|
||||
details/meta/remove-pointer.hxx details/condition.hxx \
|
||||
details/buffer.hxx details/shared-ptr.hxx \
|
||||
details/transfer-ptr.hxx details/mutex.hxx \
|
||||
details/c-string.hxx details/export.hxx \
|
||||
details/function-wrapper.ixx details/unused.hxx \
|
||||
details/config.hxx details/unique-ptr.hxx polymorphic-map.ixx \
|
||||
cache-traits.hxx simple-object-result.txx std-map-traits.hxx \
|
||||
lazy-pointer-traits.hxx std-forward-list-traits.hxx \
|
||||
lazy-ptr-impl.ixx core.hxx simple-object-result.hxx result.txx \
|
||||
polymorphic-info.hxx database.txx tr1/pointer-traits.hxx \
|
||||
tr1/lazy-ptr.hxx tr1/memory.hxx tr1/lazy-pointer-traits.hxx \
|
||||
tr1/lazy-ptr.ixx tr1/wrapper-traits.hxx tr1/lazy-ptr.txx \
|
||||
pre.hxx query-dynamic.ixx query.hxx transaction.ixx \
|
||||
callback.hxx lazy-ptr.ixx polymorphic-object-result.hxx \
|
||||
wrapper-traits.hxx exceptions.hxx nullable.hxx \
|
||||
no-id-object-result.hxx session.txx lazy-ptr.txx \
|
||||
vector-impl.hxx database.hxx std-deque-traits.hxx \
|
||||
statement-processing-common.hxx details/win32/windows.hxx \
|
||||
details/posix/thread.hxx details/posix/tls.hxx \
|
||||
details/posix/condition.hxx details/posix/mutex.ixx \
|
||||
details/posix/mutex.hxx details/posix/thread.ixx \
|
||||
details/posix/tls.ixx details/posix/tls.txx \
|
||||
details/posix/condition.ixx details/posix/exceptions.hxx \
|
||||
details/win32/lock.hxx details/win32/thread.hxx \
|
||||
details/win32/once-init.hxx details/win32/tls.hxx \
|
||||
details/win32/condition.hxx details/win32/tls-init.hxx \
|
||||
details/win32/mutex.ixx details/win32/mutex.hxx \
|
||||
details/win32/once.hxx details/win32/once.ixx \
|
||||
details/win32/tls.ixx details/win32/tls.txx \
|
||||
details/win32/condition.ixx details/win32/init.hxx \
|
||||
details/win32/exceptions.hxx
|
||||
HEADERS = $(nobase_nodist_odbinclude_HEADERS) \
|
||||
$(nobase_odbinclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PTHREAD_CXX = @PTHREAD_CXX@
|
||||
PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@
|
||||
PTHREAD_LIBS = @PTHREAD_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
acx_pthread_config = @acx_pthread_config@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
lib_LTLIBRARIES = libodb.la
|
||||
libodb_la_SOURCES = callback.cxx exceptions.cxx database.cxx \
|
||||
vector-impl.cxx connection.cxx lazy-ptr-impl.cxx \
|
||||
prepared-query.cxx query-dynamic.cxx result.cxx \
|
||||
schema-catalog.cxx section.cxx session.cxx statement.cxx \
|
||||
statement-processing.cxx tracer.cxx transaction.cxx \
|
||||
details/buffer.cxx details/condition.cxx details/lock.cxx \
|
||||
details/mutex.cxx details/shared-ptr/base.cxx $(am__append_2) \
|
||||
$(am__append_4)
|
||||
odbincludedir = $(includedir)/odb
|
||||
nobase_odbinclude_HEADERS = std-unordered-map-traits.hxx \
|
||||
query-dynamic.txx traits.hxx schema-catalog-impl.hxx \
|
||||
version.hxx polymorphic-map.hxx result.hxx lazy-ptr-impl.txx \
|
||||
schema-catalog.hxx pointer-traits.hxx std-list-traits.hxx \
|
||||
compilers/vc/post.hxx compilers/vc/pre.hxx query-dynamic.hxx \
|
||||
statement.hxx vector-traits.hxx object-result.hxx \
|
||||
std-set-traits.hxx lazy-ptr.hxx vector.hxx prepared-query.hxx \
|
||||
exception.hxx vector-impl.ixx vector.ixx std-array-traits.hxx \
|
||||
no-op-cache-traits.hxx section.hxx no-id-object-result.txx \
|
||||
lazy-ptr-impl.hxx container-traits.hxx view-result.hxx \
|
||||
transaction.hxx polymorphic-object-result.txx view-image.hxx \
|
||||
connection.ixx connection.txx std-vector-traits.hxx \
|
||||
view-result.txx tracer.hxx database.ixx post.hxx \
|
||||
schema-version.hxx vector-traits.txx session.ixx forward.hxx \
|
||||
polymorphic-map.txx function-table.hxx session.hxx \
|
||||
connection.hxx std-unordered-set-traits.hxx details/lock.hxx \
|
||||
details/thread.hxx details/shared-ptr-fwd.hxx details/tls.hxx \
|
||||
details/wrapper-p.hxx details/shared-ptr/base.txx \
|
||||
details/shared-ptr/exception.hxx \
|
||||
details/shared-ptr/counter-type.hxx \
|
||||
details/shared-ptr/base.ixx details/shared-ptr/base.hxx \
|
||||
details/exception.hxx details/type-info.hxx \
|
||||
details/function-wrapper.hxx details/function-wrapper.txx \
|
||||
details/meta/remove-volatile.hxx details/meta/class-p.hxx \
|
||||
details/meta/remove-const.hxx details/meta/static-assert.hxx \
|
||||
details/meta/remove-const-volatile.hxx \
|
||||
details/meta/polymorphic-p.hxx details/meta/answer.hxx \
|
||||
details/meta/remove-pointer.hxx details/condition.hxx \
|
||||
details/buffer.hxx details/shared-ptr.hxx \
|
||||
details/transfer-ptr.hxx details/mutex.hxx \
|
||||
details/c-string.hxx details/export.hxx \
|
||||
details/function-wrapper.ixx details/unused.hxx \
|
||||
details/config.hxx details/unique-ptr.hxx polymorphic-map.ixx \
|
||||
cache-traits.hxx simple-object-result.txx std-map-traits.hxx \
|
||||
lazy-pointer-traits.hxx std-forward-list-traits.hxx \
|
||||
lazy-ptr-impl.ixx core.hxx simple-object-result.hxx result.txx \
|
||||
polymorphic-info.hxx database.txx tr1/pointer-traits.hxx \
|
||||
tr1/lazy-ptr.hxx tr1/memory.hxx tr1/lazy-pointer-traits.hxx \
|
||||
tr1/lazy-ptr.ixx tr1/wrapper-traits.hxx tr1/lazy-ptr.txx \
|
||||
pre.hxx query-dynamic.ixx query.hxx transaction.ixx \
|
||||
callback.hxx lazy-ptr.ixx polymorphic-object-result.hxx \
|
||||
wrapper-traits.hxx exceptions.hxx nullable.hxx \
|
||||
no-id-object-result.hxx session.txx lazy-ptr.txx \
|
||||
vector-impl.hxx database.hxx std-deque-traits.hxx \
|
||||
statement-processing-common.hxx $(am__append_1) \
|
||||
$(am__append_3) $(am__append_5)
|
||||
nobase_nodist_odbinclude_HEADERS = details/config.h
|
||||
EXTRA_DIST = details/config-vc.h libodb-vc8.vcproj libodb-vc9.vcproj libodb-vc10.vcxproj libodb-vc10.vcxproj.filters libodb-vc11.vcxproj libodb-vc11.vcxproj.filters libodb-vc12.vcxproj libodb-vc12.vcxproj.filters
|
||||
AM_CPPFLAGS = -I'$(top_builddir)' -I'$(top_srcdir)' -DLIBODB_DYNAMIC_LIB
|
||||
AM_LDFLAGS = -release 2.4 -no-undefined
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cxx .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign odb/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign odb/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then rm -f stamp-h1; else :; fi
|
||||
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status odb/config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
|
||||
}
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
details/$(am__dirstamp):
|
||||
@$(MKDIR_P) details
|
||||
@: > details/$(am__dirstamp)
|
||||
details/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) details/$(DEPDIR)
|
||||
@: > details/$(DEPDIR)/$(am__dirstamp)
|
||||
details/buffer.lo: details/$(am__dirstamp) \
|
||||
details/$(DEPDIR)/$(am__dirstamp)
|
||||
details/condition.lo: details/$(am__dirstamp) \
|
||||
details/$(DEPDIR)/$(am__dirstamp)
|
||||
details/lock.lo: details/$(am__dirstamp) \
|
||||
details/$(DEPDIR)/$(am__dirstamp)
|
||||
details/mutex.lo: details/$(am__dirstamp) \
|
||||
details/$(DEPDIR)/$(am__dirstamp)
|
||||
details/shared-ptr/$(am__dirstamp):
|
||||
@$(MKDIR_P) details/shared-ptr
|
||||
@: > details/shared-ptr/$(am__dirstamp)
|
||||
details/shared-ptr/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) details/shared-ptr/$(DEPDIR)
|
||||
@: > details/shared-ptr/$(DEPDIR)/$(am__dirstamp)
|
||||
details/shared-ptr/base.lo: details/shared-ptr/$(am__dirstamp) \
|
||||
details/shared-ptr/$(DEPDIR)/$(am__dirstamp)
|
||||
details/posix/$(am__dirstamp):
|
||||
@$(MKDIR_P) details/posix
|
||||
@: > details/posix/$(am__dirstamp)
|
||||
details/posix/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) details/posix/$(DEPDIR)
|
||||
@: > details/posix/$(DEPDIR)/$(am__dirstamp)
|
||||
details/posix/exceptions.lo: details/posix/$(am__dirstamp) \
|
||||
details/posix/$(DEPDIR)/$(am__dirstamp)
|
||||
details/posix/thread.lo: details/posix/$(am__dirstamp) \
|
||||
details/posix/$(DEPDIR)/$(am__dirstamp)
|
||||
details/win32/$(am__dirstamp):
|
||||
@$(MKDIR_P) details/win32
|
||||
@: > details/win32/$(am__dirstamp)
|
||||
details/win32/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) details/win32/$(DEPDIR)
|
||||
@: > details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
details/win32/init.lo: details/win32/$(am__dirstamp) \
|
||||
details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
details/win32/once.lo: details/win32/$(am__dirstamp) \
|
||||
details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
details/win32/tls.lo: details/win32/$(am__dirstamp) \
|
||||
details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
details/win32/condition.lo: details/win32/$(am__dirstamp) \
|
||||
details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
details/win32/thread.lo: details/win32/$(am__dirstamp) \
|
||||
details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
details/win32/exceptions.lo: details/win32/$(am__dirstamp) \
|
||||
details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
details/win32/dll.lo: details/win32/$(am__dirstamp) \
|
||||
details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
libodb.la: $(libodb_la_OBJECTS) $(libodb_la_DEPENDENCIES) $(EXTRA_libodb_la_DEPENDENCIES)
|
||||
$(CXXLINK) -rpath $(libdir) $(libodb_la_OBJECTS) $(libodb_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
-rm -f details/*.$(OBJEXT)
|
||||
-rm -f details/*.lo
|
||||
-rm -f details/posix/*.$(OBJEXT)
|
||||
-rm -f details/posix/*.lo
|
||||
-rm -f details/shared-ptr/*.$(OBJEXT)
|
||||
-rm -f details/shared-ptr/*.lo
|
||||
-rm -f details/win32/*.$(OBJEXT)
|
||||
-rm -f details/win32/*.lo
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callback.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exceptions.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lazy-ptr-impl.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prepared-query.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query-dynamic.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/result.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schema-catalog.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/section.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement-processing.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tracer.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transaction.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector-impl.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/$(DEPDIR)/buffer.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/$(DEPDIR)/condition.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/$(DEPDIR)/lock.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/$(DEPDIR)/mutex.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/posix/$(DEPDIR)/exceptions.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/posix/$(DEPDIR)/thread.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/shared-ptr/$(DEPDIR)/base.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/win32/$(DEPDIR)/condition.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/win32/$(DEPDIR)/dll.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/win32/$(DEPDIR)/exceptions.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/win32/$(DEPDIR)/init.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/win32/$(DEPDIR)/once.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/win32/$(DEPDIR)/thread.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@details/win32/$(DEPDIR)/tls.Plo@am__quote@
|
||||
|
||||
.cxx.o:
|
||||
@am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@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 $@ $<
|
||||
|
||||
.cxx.obj:
|
||||
@am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@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) '$<'`
|
||||
|
||||
.cxx.lo:
|
||||
@am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
||||
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
|
||||
@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
|
||||
-rm -rf details/.libs details/_libs
|
||||
-rm -rf details/posix/.libs details/posix/_libs
|
||||
-rm -rf details/shared-ptr/.libs details/shared-ptr/_libs
|
||||
-rm -rf details/win32/.libs details/win32/_libs
|
||||
install-nobase_nodist_odbincludeHEADERS: $(nobase_nodist_odbinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(nobase_nodist_odbinclude_HEADERS)'; test -n "$(odbincludedir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(odbincludedir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(odbincludedir)" || exit 1; \
|
||||
fi; \
|
||||
$(am__nobase_list) | while read dir files; do \
|
||||
xfiles=; for file in $$files; do \
|
||||
if test -f "$$file"; then xfiles="$$xfiles $$file"; \
|
||||
else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
|
||||
test -z "$$xfiles" || { \
|
||||
test "x$$dir" = x. || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(odbincludedir)/$$dir'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(odbincludedir)/$$dir"; }; \
|
||||
echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(odbincludedir)/$$dir'"; \
|
||||
$(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(odbincludedir)/$$dir" || exit $$?; }; \
|
||||
done
|
||||
|
||||
uninstall-nobase_nodist_odbincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(nobase_nodist_odbinclude_HEADERS)'; test -n "$(odbincludedir)" || list=; \
|
||||
$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
|
||||
dir='$(DESTDIR)$(odbincludedir)'; $(am__uninstall_files_from_dir)
|
||||
install-nobase_odbincludeHEADERS: $(nobase_odbinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(nobase_odbinclude_HEADERS)'; test -n "$(odbincludedir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(odbincludedir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(odbincludedir)" || exit 1; \
|
||||
fi; \
|
||||
$(am__nobase_list) | while read dir files; do \
|
||||
xfiles=; for file in $$files; do \
|
||||
if test -f "$$file"; then xfiles="$$xfiles $$file"; \
|
||||
else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
|
||||
test -z "$$xfiles" || { \
|
||||
test "x$$dir" = x. || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(odbincludedir)/$$dir'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(odbincludedir)/$$dir"; }; \
|
||||
echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(odbincludedir)/$$dir'"; \
|
||||
$(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(odbincludedir)/$$dir" || exit $$?; }; \
|
||||
done
|
||||
|
||||
uninstall-nobase_odbincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(nobase_odbinclude_HEADERS)'; test -n "$(odbincludedir)" || list=; \
|
||||
$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
|
||||
dir='$(DESTDIR)$(odbincludedir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(odbincludedir)" "$(DESTDIR)$(odbincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
-rm -f details/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f details/$(am__dirstamp)
|
||||
-rm -f details/posix/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f details/posix/$(am__dirstamp)
|
||||
-rm -f details/shared-ptr/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f details/shared-ptr/$(am__dirstamp)
|
||||
-rm -f details/win32/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f details/win32/$(am__dirstamp)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR) details/$(DEPDIR) details/posix/$(DEPDIR) details/shared-ptr/$(DEPDIR) details/win32/$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-nobase_nodist_odbincludeHEADERS \
|
||||
install-nobase_odbincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR) details/$(DEPDIR) details/posix/$(DEPDIR) details/shared-ptr/$(DEPDIR) details/win32/$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-libLTLIBRARIES \
|
||||
uninstall-nobase_nodist_odbincludeHEADERS \
|
||||
uninstall-nobase_odbincludeHEADERS
|
||||
|
||||
.MAKE: all install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \
|
||||
distclean-compile distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-libLTLIBRARIES install-man \
|
||||
install-nobase_nodist_odbincludeHEADERS \
|
||||
install-nobase_odbincludeHEADERS install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-libLTLIBRARIES \
|
||||
uninstall-nobase_nodist_odbincludeHEADERS \
|
||||
uninstall-nobase_odbincludeHEADERS
|
||||
|
||||
|
||||
# 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:
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
// file : odb/cache-traits.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_CACHE_TRAITS_HXX
|
||||
#define ODB_CACHE_TRAITS_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/traits.hxx>
|
||||
#include <odb/forward.hxx>
|
||||
#include <odb/session.hxx>
|
||||
#include <odb/pointer-traits.hxx>
|
||||
#include <odb/no-op-cache-traits.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
// pointer_cache_traits
|
||||
//
|
||||
// Caching traits for objects passed by pointer. P should be the canonical
|
||||
// pointer (non-const).
|
||||
//
|
||||
template <typename P, typename S, pointer_kind pk>
|
||||
struct pointer_cache_traits_impl
|
||||
{
|
||||
typedef P pointer_type;
|
||||
typedef S session_type;
|
||||
typedef odb::pointer_traits<pointer_type> pointer_traits;
|
||||
typedef typename pointer_traits::element_type object_type;
|
||||
typedef typename object_traits<object_type>::id_type id_type;
|
||||
typedef typename session_type::template cache_position<object_type>
|
||||
position_type;
|
||||
|
||||
struct insert_guard
|
||||
{
|
||||
insert_guard () {}
|
||||
insert_guard (const position_type& pos): pos_ (pos) {}
|
||||
~insert_guard () {session_type::_cache_erase (pos_);}
|
||||
|
||||
const position_type&
|
||||
position () const {return pos_;}
|
||||
|
||||
void
|
||||
release () {pos_ = position_type ();}
|
||||
|
||||
// Note: doesn't call erase() on the old position (assumes empty).
|
||||
//
|
||||
void
|
||||
reset (const position_type& pos) {pos_ = pos;}
|
||||
|
||||
private:
|
||||
position_type pos_;
|
||||
};
|
||||
|
||||
// Cache management.
|
||||
//
|
||||
// We need the insert() overload with explicit id to handle self-
|
||||
// references. In such cases the object is not yet loaded and the
|
||||
// id member does not contain the correct id.
|
||||
//
|
||||
// Qualify the database type to resolve a phony ambiguity in VC 10.
|
||||
//
|
||||
static position_type
|
||||
insert (odb::database& db, const id_type& id, const pointer_type& p)
|
||||
{
|
||||
return session_type::template _cache_insert<object_type> (db, id, p);
|
||||
}
|
||||
|
||||
static position_type
|
||||
insert (odb::database& db, const pointer_type& p)
|
||||
{
|
||||
const id_type& id (
|
||||
object_traits<object_type>::id (
|
||||
pointer_traits::get_ref (p)));
|
||||
|
||||
return session_type::template _cache_insert<object_type> (db, id, p);
|
||||
}
|
||||
|
||||
static pointer_type
|
||||
find (odb::database& db, const id_type& id)
|
||||
{
|
||||
return session_type::template _cache_find<object_type> (db, id);
|
||||
}
|
||||
|
||||
static void
|
||||
erase (const position_type& p)
|
||||
{
|
||||
session_type::template _cache_erase<object_type> (p);
|
||||
}
|
||||
|
||||
// Notifications.
|
||||
//
|
||||
static void
|
||||
persist (const position_type& p)
|
||||
{
|
||||
session_type::template _cache_persist<object_type> (p);
|
||||
}
|
||||
|
||||
static void
|
||||
load (const position_type& p)
|
||||
{
|
||||
session_type::template _cache_load<object_type> (p);
|
||||
}
|
||||
|
||||
static void
|
||||
update (odb::database& db, const object_type& obj)
|
||||
{
|
||||
session_type::template _cache_update<object_type> (db, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
erase (odb::database& db, const id_type& id)
|
||||
{
|
||||
session_type::template _cache_erase<object_type> (db, id);
|
||||
}
|
||||
};
|
||||
|
||||
// Unique pointers don't work with the object cache.
|
||||
//
|
||||
template <typename P, typename S>
|
||||
struct pointer_cache_traits_impl<P, S, pk_unique>:
|
||||
no_op_pointer_cache_traits<P> {};
|
||||
|
||||
template <typename P, typename S>
|
||||
struct pointer_cache_traits:
|
||||
pointer_cache_traits_impl<P, S, pointer_traits<P>::kind> {};
|
||||
|
||||
// reference_cache_traits
|
||||
//
|
||||
// Caching traits for objects passed by reference. T should be the
|
||||
// canonical object type (non-const). Only if the object pointer
|
||||
// kind is raw do we add the object to the session.
|
||||
//
|
||||
template <typename T, typename S, pointer_kind pk>
|
||||
struct reference_cache_traits_impl: no_op_reference_cache_traits<T> {};
|
||||
|
||||
template <typename T, typename S>
|
||||
struct reference_cache_traits_impl<T, S, pk_raw>
|
||||
{
|
||||
typedef T object_type;
|
||||
typedef typename object_traits<object_type>::pointer_type pointer_type;
|
||||
typedef typename object_traits<object_type>::id_type id_type;
|
||||
|
||||
typedef pointer_cache_traits<pointer_type, S> pointer_traits;
|
||||
typedef typename pointer_traits::position_type position_type;
|
||||
typedef typename pointer_traits::insert_guard insert_guard;
|
||||
|
||||
static position_type
|
||||
insert (odb::database& db, const id_type& id, object_type& obj)
|
||||
{
|
||||
pointer_type p (&obj);
|
||||
return pointer_traits::insert (db, id, p);
|
||||
}
|
||||
|
||||
static position_type
|
||||
insert (odb::database& db, object_type& obj)
|
||||
{
|
||||
pointer_type p (&obj);
|
||||
return pointer_traits::insert (db, p);
|
||||
}
|
||||
|
||||
static void
|
||||
persist (const position_type& p)
|
||||
{
|
||||
pointer_traits::persist (p);
|
||||
}
|
||||
|
||||
static void
|
||||
load (const position_type& p)
|
||||
{
|
||||
pointer_traits::load (p);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename S>
|
||||
struct reference_cache_traits:
|
||||
reference_cache_traits_impl<
|
||||
T, S, pointer_traits<typename object_traits<T>::pointer_type>::kind> {};
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_CACHE_TRAITS_HXX
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// file : odb/callback.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/callback.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
// This otherwise unnecessary file is here to allow instantiation
|
||||
// of inline functions for exporting.
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
// file : odb/callback.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_CALLBACK_HXX
|
||||
#define ODB_CALLBACK_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/forward.hxx> // odb::core
|
||||
#include <odb/details/export.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
struct LIBODB_EXPORT callback_event
|
||||
{
|
||||
enum value
|
||||
{
|
||||
pre_persist,
|
||||
post_persist,
|
||||
pre_load,
|
||||
post_load,
|
||||
pre_update,
|
||||
post_update,
|
||||
pre_erase,
|
||||
post_erase
|
||||
};
|
||||
|
||||
callback_event (value v): v_ (v) {}
|
||||
operator value () const {return v_;}
|
||||
|
||||
private:
|
||||
value v_;
|
||||
};
|
||||
|
||||
namespace common
|
||||
{
|
||||
using odb::callback_event;
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_CALLBACK_HXX
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// file : odb/compilers/vc/post.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#pragma warning (pop)
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// file : odb/compilers/vc/pre.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
// Push warning state.
|
||||
//
|
||||
#pragma warning (push, 3)
|
||||
|
||||
// Disabled warnings.
|
||||
//
|
||||
#pragma warning (disable:4068) // unknown pragma
|
||||
#pragma warning (disable:4251) // needs to have DLL-interface
|
||||
#pragma warning (disable:4290) // exception specification ignored
|
||||
#pragma warning (disable:4355) // passing 'this' to a member
|
||||
#pragma warning (disable:4800) // forcing value to bool
|
||||
#pragma warning (disable:4231) // non-standard extension (extern template)
|
||||
|
||||
// Elevated warnings.
|
||||
//
|
||||
#pragma warning (2:4239) // standard doesn't allow this conversion
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/* odb/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have POSIX threads libraries and header files. */
|
||||
#undef HAVE_PTHREAD
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Static library interface. */
|
||||
#undef LIBODB_STATIC_LIB
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Have no threads. */
|
||||
#undef ODB_THREADS_NONE
|
||||
|
||||
/* Have POSIX threads. */
|
||||
#undef ODB_THREADS_POSIX
|
||||
|
||||
/* Have __thread keyword. */
|
||||
#undef ODB_THREADS_TLS_KEYWORD
|
||||
|
||||
/* Have Win32 threads. */
|
||||
#undef ODB_THREADS_WIN32
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
// file : odb/connection.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/database.hxx>
|
||||
#include <odb/connection.hxx>
|
||||
#include <odb/result.hxx>
|
||||
#include <odb/prepared-query.hxx>
|
||||
#include <odb/exceptions.hxx> // prepared_*
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace odb
|
||||
{
|
||||
connection::
|
||||
~connection ()
|
||||
{
|
||||
assert (prepared_queries_ == 0);
|
||||
assert (prepared_map_.empty ());
|
||||
}
|
||||
|
||||
void connection::
|
||||
clear_prepared_map ()
|
||||
{
|
||||
for (prepared_map_type::iterator i (prepared_map_.begin ()),
|
||||
e (prepared_map_.end ()); i != e; ++i)
|
||||
{
|
||||
if (i->second.params != 0)
|
||||
i->second.params_deleter (i->second.params);
|
||||
}
|
||||
|
||||
prepared_map_.clear ();
|
||||
}
|
||||
|
||||
void connection::
|
||||
recycle ()
|
||||
{
|
||||
while (prepared_queries_ != 0)
|
||||
{
|
||||
prepared_queries_->stmt.reset ();
|
||||
prepared_queries_->list_remove ();
|
||||
}
|
||||
}
|
||||
|
||||
void connection::
|
||||
invalidate_results ()
|
||||
{
|
||||
while (results_ != 0)
|
||||
{
|
||||
results_->invalidate ();
|
||||
results_->list_remove ();
|
||||
}
|
||||
}
|
||||
|
||||
void connection::
|
||||
cache_query_ (prepared_query_impl* pq,
|
||||
const type_info& ti,
|
||||
void* params,
|
||||
const type_info* params_info,
|
||||
void (*params_deleter) (void*))
|
||||
{
|
||||
pair<prepared_map_type::iterator, bool> r (
|
||||
prepared_map_.insert (
|
||||
prepared_map_type::value_type (pq->name, prepared_entry_type ())));
|
||||
|
||||
if (!r.second)
|
||||
throw prepared_already_cached (pq->name);
|
||||
|
||||
prepared_entry_type& e (r.first->second);
|
||||
|
||||
// Mark this prepared query as cached , get its ref count to 1
|
||||
// (prepared_query instances now reference this impl object),
|
||||
// and remove it from the invalidation list.
|
||||
//
|
||||
pq->cached = true;
|
||||
|
||||
while (pq->_ref_count () > 1)
|
||||
pq->_dec_ref ();
|
||||
|
||||
pq->list_remove ();
|
||||
|
||||
e.prep_query.reset (pq);
|
||||
e.type_info = &ti;
|
||||
e.params = params;
|
||||
e.params_info = params_info;
|
||||
e.params_deleter = params_deleter;
|
||||
}
|
||||
|
||||
prepared_query_impl* connection::
|
||||
lookup_query_ (const char* name,
|
||||
const type_info& ti,
|
||||
void** params,
|
||||
const type_info* params_info) const
|
||||
{
|
||||
prepared_map_type::const_iterator i (prepared_map_.find (name));
|
||||
|
||||
if (i == prepared_map_.end ())
|
||||
{
|
||||
// Use a factory, if there is one.
|
||||
//
|
||||
if (database_.call_query_factory (name,
|
||||
const_cast<connection&> (*this)))
|
||||
i = prepared_map_.find (name);
|
||||
}
|
||||
|
||||
if (i == prepared_map_.end ())
|
||||
return 0;
|
||||
|
||||
// Make sure the types match.
|
||||
//
|
||||
if (*i->second.type_info != ti)
|
||||
throw prepared_type_mismatch (name);
|
||||
|
||||
if (params != 0)
|
||||
{
|
||||
if (*i->second.params_info != *params_info)
|
||||
throw prepared_type_mismatch (name);
|
||||
|
||||
*params = i->second.params;
|
||||
}
|
||||
|
||||
return i->second.prep_query.get ();
|
||||
}
|
||||
}
|
||||
+213
@@ -0,0 +1,213 @@
|
||||
// file : odb/connection.hxx
|
||||
// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_CONNECTION_HXX
|
||||
#define ODB_CONNECTION_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <memory> // std::auto_ptr, std::unique_ptr
|
||||
#include <cstddef> // std::size_t
|
||||
#include <typeinfo>
|
||||
|
||||
#include <odb/forward.hxx>
|
||||
#include <odb/traits.hxx>
|
||||
#include <odb/query.hxx>
|
||||
#include <odb/prepared-query.hxx>
|
||||
|
||||
#include <odb/details/config.hxx> // ODB_CXX11
|
||||
#include <odb/details/export.hxx>
|
||||
#include <odb/details/c-string.hxx>
|
||||
#include <odb/details/shared-ptr.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
class transaction_impl;
|
||||
|
||||
class connection;
|
||||
typedef details::shared_ptr<connection> connection_ptr;
|
||||
|
||||
class LIBODB_EXPORT connection: public details::shared_base
|
||||
{
|
||||
public:
|
||||
typedef odb::database database_type;
|
||||
|
||||
database_type&
|
||||
database ();
|
||||
|
||||
// Transactions.
|
||||
//
|
||||
public:
|
||||
virtual transaction_impl*
|
||||
begin () = 0;
|
||||
|
||||
// Native database statement execution. Note that unlike the
|
||||
// versions in the database class, these can be executed
|
||||
// without a transaction.
|
||||
//
|
||||
public:
|
||||
unsigned long long
|
||||
execute (const char* statement);
|
||||
|
||||
unsigned long long
|
||||
execute (const std::string& statement);
|
||||
|
||||
virtual unsigned long long
|
||||
execute (const char* statement, std::size_t length) = 0;
|
||||
|
||||
// Query preparation.
|
||||
//
|
||||
public:
|
||||
template <typename T>
|
||||
prepared_query<T>
|
||||
prepare_query (const char* name, const char*);
|
||||
|
||||
template <typename T>
|
||||
prepared_query<T>
|
||||
prepare_query (const char* name, const std::string&);
|
||||
|
||||
template <typename T>
|
||||
prepared_query<T>
|
||||
prepare_query (const char* name, const query<T>&);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
cache_query (const prepared_query<T>&);
|
||||
|
||||
template <typename T, typename P>
|
||||
void
|
||||
cache_query (const prepared_query<T>&, std::auto_ptr<P> params);
|
||||
|
||||
#ifdef ODB_CXX11
|
||||
template <typename T, typename P>
|
||||
void
|
||||
cache_query (const prepared_query<T>&, std::unique_ptr<P> params);
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
prepared_query<T>
|
||||
lookup_query (const char* name) const;
|
||||
|
||||
template <typename T, typename P>
|
||||
prepared_query<T>
|
||||
lookup_query (const char* name, P*& params) const;
|
||||
|
||||
// SQL statement tracing.
|
||||
//
|
||||
public:
|
||||
typedef odb::tracer tracer_type;
|
||||
|
||||
void
|
||||
tracer (tracer_type&);
|
||||
|
||||
void
|
||||
tracer (tracer_type*);
|
||||
|
||||
tracer_type*
|
||||
tracer () const;
|
||||
|
||||
public:
|
||||
// Store the transaction-spacific tracer in the connection. If we
|
||||
// were to store it in the transaction, then in order to check if
|
||||
// it was set, we would need to get the transaction instance using
|
||||
// the current() API. But that requires a TLS lookup, which can be
|
||||
// slow.
|
||||
//
|
||||
tracer_type*
|
||||
transaction_tracer () const;
|
||||
|
||||
public:
|
||||
virtual
|
||||
~connection ();
|
||||
|
||||
// Recycle the connection to be used by another thread. This call
|
||||
// invalidates uncached prepared queries.
|
||||
//
|
||||
void
|
||||
recycle ();
|
||||
|
||||
protected:
|
||||
connection (database_type&);
|
||||
|
||||
template <typename T,
|
||||
database_id DB,
|
||||
class_kind kind = class_traits<T>::kind>
|
||||
struct query_;
|
||||
|
||||
virtual void
|
||||
cache_query_ (prepared_query_impl* pq,
|
||||
const std::type_info& ti,
|
||||
void* params,
|
||||
const std::type_info* params_info,
|
||||
void (*params_deleter) (void*));
|
||||
|
||||
prepared_query_impl*
|
||||
lookup_query_ (const char* name,
|
||||
const std::type_info& ti,
|
||||
void** params, // out
|
||||
const std::type_info* params_info) const;
|
||||
|
||||
template <typename P>
|
||||
static void
|
||||
params_deleter (void*);
|
||||
|
||||
private:
|
||||
connection (const connection&);
|
||||
connection& operator= (const connection&);
|
||||
|
||||
// Prepared query cache.
|
||||
//
|
||||
protected:
|
||||
struct prepared_entry_type
|
||||
{
|
||||
details::shared_ptr<prepared_query_impl> prep_query;
|
||||
const std::type_info* type_info;
|
||||
void* params;
|
||||
const std::type_info* params_info;
|
||||
void (*params_deleter) (void*);
|
||||
};
|
||||
|
||||
typedef
|
||||
std::map<const char*, prepared_entry_type, details::c_string_comparator>
|
||||
prepared_map_type;
|
||||
|
||||
prepared_map_type prepared_map_;
|
||||
|
||||
void
|
||||
clear_prepared_map ();
|
||||
|
||||
protected:
|
||||
database_type& database_;
|
||||
tracer_type* tracer_;
|
||||
|
||||
// Active query result list.
|
||||
//
|
||||
protected:
|
||||
friend class result_impl;
|
||||
result_impl* results_;
|
||||
|
||||
void
|
||||
invalidate_results ();
|
||||
|
||||
// Prepared but uncached query list (cached ones are stored in
|
||||
// prepared_map_).
|
||||
//
|
||||
protected:
|
||||
friend class prepared_query_impl;
|
||||
prepared_query_impl* prepared_queries_;
|
||||
|
||||
protected:
|
||||
friend class transaction;
|
||||
tracer_type* transaction_tracer_;
|
||||
};
|
||||
}
|
||||
|
||||
#include <odb/connection.ixx>
|
||||
#include <odb/connection.txx>
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_CONNECTION_HXX
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
// file : odb/connection.ixx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <cstring> // std::string
|
||||
#include <cassert>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
inline connection::
|
||||
connection (database_type& database)
|
||||
: database_ (database),
|
||||
tracer_ (0),
|
||||
results_ (0),
|
||||
prepared_queries_ (0),
|
||||
transaction_tracer_ (0)
|
||||
{
|
||||
}
|
||||
|
||||
inline connection::database_type& connection::
|
||||
database ()
|
||||
{
|
||||
return database_;
|
||||
}
|
||||
|
||||
inline unsigned long long connection::
|
||||
execute (const char* st)
|
||||
{
|
||||
return execute (st, std::strlen (st));
|
||||
}
|
||||
|
||||
inline unsigned long long connection::
|
||||
execute (const std::string& st)
|
||||
{
|
||||
return execute (st.c_str (), st.size ());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline prepared_query<T> connection::
|
||||
prepare_query (const char* n, const char* q)
|
||||
{
|
||||
return prepare_query<T> (n, query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline prepared_query<T> connection::
|
||||
prepare_query (const char* n, const std::string& q)
|
||||
{
|
||||
return prepare_query<T> (n, query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline prepared_query<T> connection::
|
||||
prepare_query (const char* n, const query<T>& q)
|
||||
{
|
||||
return query_<T, id_common>::call (*this, n, q);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void connection::
|
||||
cache_query (const prepared_query<T>& pq)
|
||||
{
|
||||
assert (pq);
|
||||
cache_query_ (pq.impl_, typeid (T), 0, 0, 0);
|
||||
}
|
||||
|
||||
template <typename T, typename P>
|
||||
inline void connection::
|
||||
cache_query (const prepared_query<T>& pq, std::auto_ptr<P> params)
|
||||
{
|
||||
assert (pq);
|
||||
assert (params.get () != 0);
|
||||
cache_query_ (
|
||||
pq.impl_, typeid (T), params.get (), &typeid (P), ¶ms_deleter<P>);
|
||||
params.release ();
|
||||
}
|
||||
|
||||
#ifdef ODB_CXX11
|
||||
template <typename T, typename P>
|
||||
inline void connection::
|
||||
cache_query (const prepared_query<T>& pq, std::unique_ptr<P> params)
|
||||
{
|
||||
assert (pq);
|
||||
assert (params);
|
||||
cache_query_ (
|
||||
pq.impl_, typeid (T), params.get (), &typeid (P), ¶ms_deleter<P>);
|
||||
params.release ();
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
inline prepared_query<T> connection::
|
||||
lookup_query (const char* name) const
|
||||
{
|
||||
return prepared_query<T> (lookup_query_ (name, typeid (T), 0, 0));
|
||||
}
|
||||
|
||||
template <typename T, typename P>
|
||||
inline prepared_query<T> connection::
|
||||
lookup_query (const char* name, P*& params) const
|
||||
{
|
||||
return prepared_query<T> (
|
||||
lookup_query_ (name,
|
||||
typeid (T),
|
||||
reinterpret_cast<void**> (¶ms),
|
||||
&typeid (P)));
|
||||
}
|
||||
|
||||
inline void connection::
|
||||
tracer (tracer_type& t)
|
||||
{
|
||||
tracer_ = &t;
|
||||
}
|
||||
|
||||
inline void connection::
|
||||
tracer (tracer_type* t)
|
||||
{
|
||||
tracer_ = t;
|
||||
}
|
||||
|
||||
inline connection::tracer_type* connection::
|
||||
tracer () const
|
||||
{
|
||||
return tracer_;
|
||||
}
|
||||
|
||||
inline connection::tracer_type* connection::
|
||||
transaction_tracer () const
|
||||
{
|
||||
return transaction_tracer_;
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// file : odb/connection.txx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
namespace odb
|
||||
{
|
||||
template <typename T, database_id DB>
|
||||
struct connection::query_<T, DB, class_object>
|
||||
{
|
||||
template <typename Q>
|
||||
static prepared_query<T>
|
||||
call (connection& c, const char* n, const Q& q)
|
||||
{
|
||||
// C++ compiler complaining there is no prepare_query()? Perhaps
|
||||
// you forgot to specify --generate-prepared when compiling your
|
||||
// persistent classes.
|
||||
//
|
||||
return prepared_query<T> (
|
||||
object_traits_impl<T, DB>::prepare_query (c, n, q));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, database_id DB>
|
||||
struct connection::query_<T, DB, class_view>
|
||||
{
|
||||
template <typename Q>
|
||||
static prepared_query<T>
|
||||
call (connection& c, const char* n, const Q& q)
|
||||
{
|
||||
// C++ compiler complaining there is no prepare_query()? Perhaps
|
||||
// you forgot to specify --generate-prepared when compiling your
|
||||
// views.
|
||||
//
|
||||
return prepared_query<T> (
|
||||
view_traits_impl<T, DB>::prepare_query (c, n, q));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename P>
|
||||
void connection::
|
||||
params_deleter (void* p)
|
||||
{
|
||||
delete static_cast<P*> (p);
|
||||
}
|
||||
}
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
// file : odb/container-traits.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_CONTAINER_TRAITS_HXX
|
||||
#define ODB_CONTAINER_TRAITS_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/forward.hxx>
|
||||
#include <odb/details/config.hxx> // ODB_CXX11
|
||||
|
||||
namespace odb
|
||||
{
|
||||
// Keep this enum synchronized with the one in odb/odb/context.hxx.
|
||||
//
|
||||
enum container_kind
|
||||
{
|
||||
ck_ordered,
|
||||
ck_set,
|
||||
ck_multiset,
|
||||
ck_map,
|
||||
ck_multimap
|
||||
};
|
||||
|
||||
//
|
||||
// Container API provided by the generated code.
|
||||
//
|
||||
|
||||
// Ordered containers.
|
||||
//
|
||||
template <typename I, typename V>
|
||||
struct ordered_functions
|
||||
{
|
||||
typedef I index_type;
|
||||
typedef V value_type;
|
||||
|
||||
// Return true if the order is preserved in the database. If the
|
||||
// order is not preserved, then the index argument in the functions
|
||||
// below is not used.
|
||||
//
|
||||
bool
|
||||
ordered () const
|
||||
{
|
||||
return ordered_;
|
||||
}
|
||||
|
||||
void
|
||||
insert (I index, const V& value) const
|
||||
{
|
||||
insert_ (index, value, data_);
|
||||
}
|
||||
|
||||
bool
|
||||
select (I& next_index, V& next_value) const
|
||||
{
|
||||
return select_ (next_index, next_value, data_);
|
||||
}
|
||||
|
||||
void
|
||||
delete_ () const
|
||||
{
|
||||
delete__ (data_);
|
||||
}
|
||||
|
||||
// Implementation details.
|
||||
//
|
||||
public:
|
||||
ordered_functions (void* data): data_ (data) {}
|
||||
|
||||
public:
|
||||
void* data_;
|
||||
bool ordered_;
|
||||
|
||||
void (*insert_) (I, const V&, void*);
|
||||
bool (*select_) (I&, V&, void*);
|
||||
void (*delete__) (void*);
|
||||
};
|
||||
|
||||
template <typename I, typename V>
|
||||
struct smart_ordered_functions
|
||||
{
|
||||
typedef I index_type;
|
||||
typedef V value_type;
|
||||
|
||||
void
|
||||
insert (I index, const V& value) const
|
||||
{
|
||||
insert_ (index, value, data_);
|
||||
}
|
||||
|
||||
bool
|
||||
select (I& next_index, V& next_value) const
|
||||
{
|
||||
return select_ (next_index, next_value, data_);
|
||||
}
|
||||
|
||||
void
|
||||
update (I index, const V& value) const
|
||||
{
|
||||
update_ (index, value, data_);
|
||||
}
|
||||
|
||||
// Delete all the elements starting with the specified index. To
|
||||
// delete everything, pass 0.
|
||||
//
|
||||
void
|
||||
delete_ (I start_index) const
|
||||
{
|
||||
delete__ (start_index, data_);
|
||||
}
|
||||
|
||||
// Implementation details.
|
||||
//
|
||||
public:
|
||||
smart_ordered_functions (void* data) : data_ (data) {}
|
||||
|
||||
public:
|
||||
void* data_;
|
||||
|
||||
void (*insert_) (I, const V&, void*);
|
||||
bool (*select_) (I&, V&, void*);
|
||||
void (*update_) (I, const V&, void*);
|
||||
void (*delete__) (I, void*);
|
||||
};
|
||||
|
||||
// Set/multiset containers.
|
||||
//
|
||||
template <typename V>
|
||||
struct set_functions
|
||||
{
|
||||
typedef V value_type;
|
||||
|
||||
void
|
||||
insert (const V& value) const
|
||||
{
|
||||
insert_ (value, data_);
|
||||
}
|
||||
|
||||
bool
|
||||
select (V& next_value) const
|
||||
{
|
||||
return select_ (next_value, data_);
|
||||
}
|
||||
|
||||
void
|
||||
delete_ () const
|
||||
{
|
||||
delete__ (data_);
|
||||
}
|
||||
|
||||
// Implementation details.
|
||||
//
|
||||
public:
|
||||
set_functions (void* data): data_ (data) {}
|
||||
|
||||
public:
|
||||
void* data_;
|
||||
|
||||
void (*insert_) (const V&, void*);
|
||||
bool (*select_) (V&, void*);
|
||||
void (*delete__) (void*);
|
||||
};
|
||||
|
||||
// Map/multimap containers.
|
||||
//
|
||||
template <typename K, typename V>
|
||||
struct map_functions
|
||||
{
|
||||
typedef K key_type;
|
||||
typedef V value_type;
|
||||
|
||||
void
|
||||
insert (const K& key, const V& value) const
|
||||
{
|
||||
insert_ (key, value, data_);
|
||||
}
|
||||
|
||||
bool
|
||||
select (K& next_key, V& next_value) const
|
||||
{
|
||||
return select_ (next_key, next_value, data_);
|
||||
}
|
||||
|
||||
void
|
||||
delete_ () const
|
||||
{
|
||||
delete__ (data_);
|
||||
}
|
||||
|
||||
// Implementation details.
|
||||
//
|
||||
public:
|
||||
map_functions (void* data): data_ (data) {}
|
||||
|
||||
public:
|
||||
void* data_;
|
||||
|
||||
void (*insert_) (const K&, const V&, void*);
|
||||
bool (*select_) (K&, V&, void*);
|
||||
void (*delete__) (void*);
|
||||
};
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#include <odb/std-map-traits.hxx>
|
||||
#include <odb/std-set-traits.hxx>
|
||||
#include <odb/std-list-traits.hxx>
|
||||
#include <odb/std-vector-traits.hxx>
|
||||
#include <odb/std-deque-traits.hxx>
|
||||
|
||||
#ifdef ODB_CXX11
|
||||
# include <odb/std-array-traits.hxx>
|
||||
# include <odb/std-forward-list-traits.hxx>
|
||||
# include <odb/std-unordered-map-traits.hxx>
|
||||
# include <odb/std-unordered-set-traits.hxx>
|
||||
#endif
|
||||
|
||||
#endif // ODB_CONTAINER_TRAITS_HXX
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// file : odb/core.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_CORE_HXX
|
||||
#define ODB_CORE_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#ifdef ODB_COMPILER
|
||||
# define PRAGMA_DB_IMPL(x) _Pragma (#x)
|
||||
# define PRAGMA_DB(x) PRAGMA_DB_IMPL (db x)
|
||||
#else
|
||||
# define PRAGMA_DB(x)
|
||||
#endif
|
||||
|
||||
#include <odb/forward.hxx>
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_CORE_HXX
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
// file : odb/database.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/database.hxx>
|
||||
|
||||
#include <odb/details/lock.hxx>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace odb
|
||||
{
|
||||
using details::lock;
|
||||
|
||||
database::
|
||||
~database ()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned long long database::
|
||||
execute (const char* st, std::size_t n)
|
||||
{
|
||||
connection_type& c (transaction::current ().connection ());
|
||||
return c.execute (st, n);
|
||||
}
|
||||
|
||||
const database::schema_version_migration_type& database::
|
||||
schema_version_migration (const string& name) const
|
||||
{
|
||||
lock l (mutex_); // Prevents concurrent loading.
|
||||
|
||||
schema_version_map::const_iterator i (schema_version_map_.find (name));
|
||||
return i != schema_version_map_.end () && i->second.version != 0
|
||||
? i->second
|
||||
: load_schema_version (name);
|
||||
}
|
||||
|
||||
void database::
|
||||
schema_version_migration (const schema_version_migration_type& svm,
|
||||
const string& name)
|
||||
{
|
||||
// Note: no lock, not thread-safe.
|
||||
|
||||
schema_version_info& svi (schema_version_map_[name]);
|
||||
if (svi.version != svm.version || svi.migration != svm.migration)
|
||||
{
|
||||
svi.version = svm.version;
|
||||
svi.migration = svm.migration;
|
||||
schema_version_seq_++;
|
||||
}
|
||||
}
|
||||
|
||||
bool database::
|
||||
call_query_factory (const char* name, connection_type& c) const
|
||||
{
|
||||
query_factory_map::const_iterator i (query_factory_map_.find (name));
|
||||
|
||||
if (i == query_factory_map_.end ())
|
||||
i = query_factory_map_.find (""); // Wildcard factory.
|
||||
|
||||
if (i == query_factory_map_.end ())
|
||||
return false;
|
||||
|
||||
const query_factory_wrapper& fw (i->second);
|
||||
if (fw.std_function == 0)
|
||||
fw.function (name, c);
|
||||
else
|
||||
{
|
||||
typedef void (*caller) (const void*, const char*, connection_type&);
|
||||
reinterpret_cast<caller> (fw.function) (fw.std_function, name, c);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void database::
|
||||
query_factory (const char* name, query_factory_wrapper w)
|
||||
{
|
||||
if (w)
|
||||
query_factory_map_[name] = w; // Destructive copy assignment (move).
|
||||
else
|
||||
query_factory_map_.erase (name);
|
||||
}
|
||||
}
|
||||
+636
@@ -0,0 +1,636 @@
|
||||
// file : odb/database.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DATABASE_HXX
|
||||
#define ODB_DATABASE_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/config.hxx> // ODB_CXX11
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <memory> // std::auto_ptr, std::unique_ptr
|
||||
#include <cstddef> // std::size_t
|
||||
|
||||
#ifdef ODB_CXX11
|
||||
# include <utility> // std::move
|
||||
# include <functional> // std::function
|
||||
# include <type_traits> // std::enable_if, std::is_convertible
|
||||
#endif
|
||||
|
||||
#include <odb/traits.hxx>
|
||||
#include <odb/forward.hxx>
|
||||
#include <odb/schema-version.hxx>
|
||||
#include <odb/query.hxx>
|
||||
#include <odb/prepared-query.hxx>
|
||||
#include <odb/result.hxx>
|
||||
#include <odb/connection.hxx>
|
||||
#include <odb/exceptions.hxx>
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
#include <odb/details/mutex.hxx>
|
||||
#include <odb/details/c-string.hxx>
|
||||
#include <odb/details/function-wrapper.hxx>
|
||||
#include <odb/details/meta/answer.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
class transaction_impl;
|
||||
|
||||
class LIBODB_EXPORT database
|
||||
{
|
||||
public:
|
||||
virtual
|
||||
~database ();
|
||||
|
||||
// Object persistence API.
|
||||
//
|
||||
public:
|
||||
// Make the object persistent.
|
||||
//
|
||||
template <typename T>
|
||||
typename object_traits<T>::id_type
|
||||
persist (T& object);
|
||||
|
||||
template <typename T>
|
||||
typename object_traits<T>::id_type
|
||||
persist (const T& object);
|
||||
|
||||
template <typename T>
|
||||
typename object_traits<T>::id_type
|
||||
persist (T* obj_ptr);
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
typename object_traits<T>::id_type
|
||||
persist (const P<T>& obj_ptr);
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
typename object_traits<T>::id_type
|
||||
persist (const P<T, A1>& obj_ptr);
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
typename object_traits<T>::id_type
|
||||
persist (P<T>& obj_ptr);
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
typename object_traits<T>::id_type
|
||||
persist (P<T, A1>& obj_ptr);
|
||||
|
||||
template <typename T>
|
||||
typename object_traits<T>::id_type
|
||||
persist (const typename object_traits<T>::pointer_type& obj_ptr);
|
||||
|
||||
// Bulk persist. Can be a range of references or pointers (including
|
||||
// smart pointers) to objects.
|
||||
//
|
||||
template <typename I>
|
||||
void
|
||||
persist (I begin, I end, bool continue_failed = true);
|
||||
|
||||
// Load an object. Throw object_not_persistent if not found.
|
||||
//
|
||||
template <typename T>
|
||||
typename object_traits<T>::pointer_type
|
||||
load (const typename object_traits<T>::id_type& id);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
load (const typename object_traits<T>::id_type& id, T& object);
|
||||
|
||||
// Load (or reload, if it is already loaded) a section of an object.
|
||||
//
|
||||
template <typename T>
|
||||
void
|
||||
load (T& object, section&);
|
||||
|
||||
// Reload an object.
|
||||
//
|
||||
template <typename T>
|
||||
void
|
||||
reload (T& object);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
reload (T* obj_ptr);
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
void
|
||||
reload (const P<T>& obj_ptr);
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
void
|
||||
reload (const P<T, A1>& obj_ptr);
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
void
|
||||
reload (P<T>& obj_ptr);
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
void
|
||||
reload (P<T, A1>& obj_ptr);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
reload (const typename object_traits<T>::pointer_type& obj_ptr);
|
||||
|
||||
// Loan an object if found. Return NULL/false if not found.
|
||||
//
|
||||
template <typename T>
|
||||
typename object_traits<T>::pointer_type
|
||||
find (const typename object_traits<T>::id_type& id);
|
||||
|
||||
template <typename T>
|
||||
bool
|
||||
find (const typename object_traits<T>::id_type& id, T& object);
|
||||
|
||||
// Update the state of a modified objects.
|
||||
//
|
||||
template <typename T>
|
||||
void
|
||||
update (T& object);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
update (T* obj_ptr);
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
void
|
||||
update (const P<T>& obj_ptr);
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
void
|
||||
update (const P<T, A1>& obj_ptr);
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
void
|
||||
update (P<T>& obj_ptr);
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
void
|
||||
update (P<T, A1>& obj_ptr);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
update (const typename object_traits<T>::pointer_type& obj_ptr);
|
||||
|
||||
// Bulk update. Can be a range of references or pointers (including
|
||||
// smart pointers) to objects.
|
||||
//
|
||||
template <typename I>
|
||||
void
|
||||
update (I begin, I end, bool continue_failed = true);
|
||||
|
||||
// Update a section of an object. Throws section_not_loaded exception
|
||||
// if section is not loaded. Note also that this function does not
|
||||
// clear the changed flag if it is set.
|
||||
//
|
||||
template <typename T>
|
||||
void
|
||||
update (const T& object, const section&);
|
||||
|
||||
// Make the object transient. Throw object_not_persistent if not
|
||||
// found.
|
||||
//
|
||||
template <typename T>
|
||||
void
|
||||
erase (const typename object_traits<T>::id_type& id);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
erase (T& object);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
erase (T* obj_ptr);
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
void
|
||||
erase (const P<T>& obj_ptr);
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
void
|
||||
erase (const P<T, A1>& obj_ptr);
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
void
|
||||
erase (P<T>& obj_ptr);
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
void
|
||||
erase (P<T, A1>& obj_ptr);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
erase (const typename object_traits<T>::pointer_type& obj_ptr);
|
||||
|
||||
// Bulk erase.
|
||||
//
|
||||
template <typename T, typename I>
|
||||
void
|
||||
erase (I id_begin, I id_end, bool continue_failed = true);
|
||||
|
||||
// Can be a range of references or pointers (including smart pointers)
|
||||
// to objects.
|
||||
//
|
||||
template <typename I>
|
||||
void
|
||||
erase (I obj_begin, I obj_end, bool continue_failed = true);
|
||||
|
||||
// Erase multiple objects matching a query predicate.
|
||||
//
|
||||
template <typename T>
|
||||
unsigned long long
|
||||
erase_query ();
|
||||
|
||||
template <typename T>
|
||||
unsigned long long
|
||||
erase_query (const char*);
|
||||
|
||||
template <typename T>
|
||||
unsigned long long
|
||||
erase_query (const std::string&);
|
||||
|
||||
template <typename T>
|
||||
unsigned long long
|
||||
erase_query (const odb::query<T>&);
|
||||
|
||||
// Query API.
|
||||
//
|
||||
template <typename T>
|
||||
result<T>
|
||||
query (bool cache = true);
|
||||
|
||||
template <typename T>
|
||||
result<T>
|
||||
query (const char*, bool cache = true);
|
||||
|
||||
template <typename T>
|
||||
result<T>
|
||||
query (const std::string&, bool cache = true);
|
||||
|
||||
template <typename T>
|
||||
result<T>
|
||||
query (const odb::query<T>&, bool cache = true);
|
||||
|
||||
// Query one API.
|
||||
//
|
||||
template <typename T>
|
||||
typename object_traits<T>::pointer_type
|
||||
query_one ();
|
||||
|
||||
template <typename T>
|
||||
bool
|
||||
query_one (T& object);
|
||||
|
||||
template <typename T>
|
||||
T
|
||||
query_value ();
|
||||
|
||||
template <typename T>
|
||||
typename object_traits<T>::pointer_type
|
||||
query_one (const char*);
|
||||
|
||||
template <typename T>
|
||||
bool
|
||||
query_one (const char*, T& object);
|
||||
|
||||
template <typename T>
|
||||
T
|
||||
query_value (const char*);
|
||||
|
||||
template <typename T>
|
||||
typename object_traits<T>::pointer_type
|
||||
query_one (const std::string&);
|
||||
|
||||
template <typename T>
|
||||
bool
|
||||
query_one (const std::string&, T& object);
|
||||
|
||||
template <typename T>
|
||||
T
|
||||
query_value (const std::string&);
|
||||
|
||||
template <typename T>
|
||||
typename object_traits<T>::pointer_type
|
||||
query_one (const odb::query<T>&);
|
||||
|
||||
template <typename T>
|
||||
bool
|
||||
query_one (const odb::query<T>&, T& object);
|
||||
|
||||
template <typename T>
|
||||
T
|
||||
query_value (const odb::query<T>&);
|
||||
|
||||
// Query preparation.
|
||||
//
|
||||
template <typename T>
|
||||
prepared_query<T>
|
||||
prepare_query (const char* name, const char*);
|
||||
|
||||
template <typename T>
|
||||
prepared_query<T>
|
||||
prepare_query (const char* name, const std::string&);
|
||||
|
||||
template <typename T>
|
||||
prepared_query<T>
|
||||
prepare_query (const char* name, const odb::query<T>&);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
cache_query (const prepared_query<T>&);
|
||||
|
||||
template <typename T, typename P>
|
||||
void
|
||||
cache_query (const prepared_query<T>&, std::auto_ptr<P> params);
|
||||
|
||||
#ifdef ODB_CXX11
|
||||
template <typename T, typename P>
|
||||
void
|
||||
cache_query (const prepared_query<T>&, std::unique_ptr<P> params);
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
prepared_query<T>
|
||||
lookup_query (const char* name) const;
|
||||
|
||||
template <typename T, typename P>
|
||||
prepared_query<T>
|
||||
lookup_query (const char* name, P*& params) const;
|
||||
|
||||
// Prepared query factory.
|
||||
//
|
||||
public:
|
||||
typedef odb::connection connection_type;
|
||||
|
||||
typedef void query_factory_type (const char* name, connection_type&);
|
||||
typedef query_factory_type* query_factory_ptr;
|
||||
typedef details::function_wrapper<
|
||||
query_factory_type> query_factory_wrapper;
|
||||
|
||||
#ifndef ODB_CXX11
|
||||
void
|
||||
query_factory (const char* name, query_factory_ptr);
|
||||
#else
|
||||
template <typename F>
|
||||
typename std::enable_if<
|
||||
std::is_convertible<
|
||||
F, std::function<query_factory_type>>::value, void>::type
|
||||
query_factory (const char* name, F f)
|
||||
{
|
||||
query_factory (name, query_factory_wrapper (std::move (f)));
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
call_query_factory (const char* name, connection_type&) const;
|
||||
|
||||
private:
|
||||
void
|
||||
query_factory (const char* name, query_factory_wrapper);
|
||||
|
||||
// Native database statement execution.
|
||||
//
|
||||
public:
|
||||
unsigned long long
|
||||
execute (const char* statement);
|
||||
|
||||
unsigned long long
|
||||
execute (const std::string& statement);
|
||||
|
||||
unsigned long long
|
||||
execute (const char* statement, std::size_t length);
|
||||
|
||||
// Transactions.
|
||||
//
|
||||
public:
|
||||
virtual transaction_impl*
|
||||
begin () = 0;
|
||||
|
||||
// Connections.
|
||||
//
|
||||
public:
|
||||
connection_ptr
|
||||
connection ();
|
||||
|
||||
// SQL statement tracing.
|
||||
//
|
||||
public:
|
||||
typedef odb::tracer tracer_type;
|
||||
|
||||
void
|
||||
tracer (tracer_type&);
|
||||
|
||||
void
|
||||
tracer (tracer_type*);
|
||||
|
||||
tracer_type*
|
||||
tracer () const;
|
||||
|
||||
// Database schema version.
|
||||
//
|
||||
public:
|
||||
typedef odb::schema_version schema_version_type;
|
||||
typedef odb::schema_version_migration schema_version_migration_type;
|
||||
|
||||
schema_version_type
|
||||
schema_version (const std::string& schema_name = "") const;
|
||||
|
||||
bool
|
||||
schema_migration (const std::string& schema_name = "") const;
|
||||
|
||||
// Note that there is code that relies on the returned reference
|
||||
// being valid until the version is changed or the database instance
|
||||
// is destroyed.
|
||||
//
|
||||
const schema_version_migration_type&
|
||||
schema_version_migration (const std::string& schema_name = "") const;
|
||||
|
||||
// Set schema version and migration state manually.
|
||||
//
|
||||
// Note that the modifier API is not thread-safe. That is, you should
|
||||
// not modify the schema version while other threads may be accessing
|
||||
// or modifying the same information.
|
||||
//
|
||||
void
|
||||
schema_version_migration (schema_version_type,
|
||||
bool migration,
|
||||
const std::string& schema_name = "");
|
||||
|
||||
void
|
||||
schema_version_migration (const schema_version_migration_type&,
|
||||
const std::string& schema_name = "");
|
||||
|
||||
// Set default schema version table for all the schema names. The table
|
||||
// name should already be quoted if necessary.
|
||||
//
|
||||
void
|
||||
schema_version_table (const std::string& table_name);
|
||||
|
||||
// Set schema version table for a specific schema.
|
||||
//
|
||||
void
|
||||
schema_version_table (const std::string& table_name,
|
||||
const std::string& schema_name);
|
||||
|
||||
// Schema version sequence number. It is incremented every time the
|
||||
// schema version or migration flag is changed and can be used to
|
||||
// detect overall version changes. The starting value is 1.
|
||||
//
|
||||
unsigned int
|
||||
schema_version_sequence () const;
|
||||
|
||||
protected:
|
||||
struct schema_version_info: schema_version_migration_type
|
||||
{
|
||||
std::string version_table;
|
||||
};
|
||||
|
||||
virtual const schema_version_info&
|
||||
load_schema_version (const std::string& schema_name) const = 0;
|
||||
|
||||
private:
|
||||
const schema_version_info&
|
||||
schema_version_migration_ (const std::string& schema_name) const;
|
||||
|
||||
// Database id.
|
||||
//
|
||||
public:
|
||||
database_id
|
||||
id () const;
|
||||
|
||||
protected:
|
||||
database (database_id);
|
||||
|
||||
private:
|
||||
database (const database&);
|
||||
database& operator= (const database&);
|
||||
|
||||
protected:
|
||||
virtual connection_type*
|
||||
connection_ () = 0;
|
||||
|
||||
protected:
|
||||
template <typename T, database_id DB>
|
||||
typename object_traits<T>::id_type
|
||||
persist_ (T&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
typename object_traits<T>::id_type
|
||||
persist_ (const typename object_traits<T>::pointer_type&);
|
||||
|
||||
template <typename I, database_id DB>
|
||||
void
|
||||
persist_ (I, I, bool);
|
||||
|
||||
template <typename I, typename T, database_id DB>
|
||||
void
|
||||
persist_ (I, I, bool, details::meta::no ptr);
|
||||
|
||||
template <typename I, typename T, database_id DB>
|
||||
void
|
||||
persist_ (I, I, bool, details::meta::yes ptr);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
typename object_traits<T>::pointer_type
|
||||
load_ (const typename object_traits<T>::id_type&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
load_ (const typename object_traits<T>::id_type&, T&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
load_ (T&, section&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
reload_ (T&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
typename object_traits<T>::pointer_type
|
||||
find_ (const typename object_traits<T>::id_type&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
bool
|
||||
find_ (const typename object_traits<T>::id_type&, T&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
update_ (T&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
update_ (const typename object_traits<T>::pointer_type&);
|
||||
|
||||
template <typename I, database_id DB>
|
||||
void
|
||||
update_ (I, I, bool);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
update_ (const T&, const section&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
erase_ (const typename object_traits<T>::id_type&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
erase_ (T&);
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void
|
||||
erase_ (const typename object_traits<T>::pointer_type&);
|
||||
|
||||
template <typename I, typename T, database_id DB>
|
||||
void
|
||||
erase_id_ (I, I, bool);
|
||||
|
||||
template <typename I, database_id DB>
|
||||
void
|
||||
erase_object_ (I, I, bool);
|
||||
|
||||
template <typename T, database_id DB, typename Q>
|
||||
typename object_traits<T>::pointer_type
|
||||
query_one_ (const Q&);
|
||||
|
||||
template <typename T, database_id DB, typename Q>
|
||||
bool
|
||||
query_one_ (const Q&, T&);
|
||||
|
||||
template <typename T, database_id DB, typename Q>
|
||||
T
|
||||
query_value_ (const Q&);
|
||||
|
||||
template <typename T,
|
||||
database_id DB,
|
||||
class_kind kind = class_traits<T>::kind>
|
||||
struct query_;
|
||||
|
||||
protected:
|
||||
typedef
|
||||
std::map<const char*, query_factory_wrapper, details::c_string_comparator>
|
||||
query_factory_map;
|
||||
|
||||
typedef std::map<std::string, schema_version_info> schema_version_map;
|
||||
|
||||
database_id id_;
|
||||
tracer_type* tracer_;
|
||||
query_factory_map query_factory_map_;
|
||||
|
||||
mutable details::mutex mutex_;
|
||||
mutable schema_version_map schema_version_map_;
|
||||
std::string schema_version_table_;
|
||||
unsigned int schema_version_seq_;
|
||||
};
|
||||
}
|
||||
|
||||
#include <odb/database.ixx>
|
||||
#include <odb/database.txx>
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DATABASE_HXX
|
||||
+877
@@ -0,0 +1,877 @@
|
||||
// file : odb/database.ixx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <cstring> // std::strlen()
|
||||
#include <utility> // std::move
|
||||
#include <iterator>
|
||||
|
||||
#include <odb/transaction.hxx>
|
||||
#include <odb/pointer-traits.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
template <typename T>
|
||||
struct object_pointer_traits
|
||||
{
|
||||
typedef details::meta::no result_type;
|
||||
typedef T object_type;
|
||||
static const T& get_ref (const T& x) {return x;}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct object_pointer_traits<T*>
|
||||
{
|
||||
typedef details::meta::yes result_type;
|
||||
typedef T object_type;
|
||||
static const T& get_ref (const T* p) {return *p;}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct object_pointer_traits<T* const>
|
||||
{
|
||||
typedef details::meta::yes result_type;
|
||||
typedef T object_type;
|
||||
static const T& get_ref (const T* p) {return *p;}
|
||||
};
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
struct object_pointer_traits<P<T> >
|
||||
{
|
||||
typedef details::meta::yes result_type;
|
||||
typedef T object_type;
|
||||
static const T& get_ref (const P<T>& p) {
|
||||
return pointer_traits<P<T> >::get_ref (p);}
|
||||
};
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
struct object_pointer_traits<P<T, A1> >
|
||||
{
|
||||
typedef details::meta::yes result_type;
|
||||
typedef T object_type;
|
||||
static const T& get_ref (const P<T, A1>& p) {
|
||||
return pointer_traits<P<T, A1> >::get_ref (p);}
|
||||
};
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
struct object_pointer_traits<const P<T> >
|
||||
{
|
||||
typedef details::meta::yes result_type;
|
||||
typedef T object_type;
|
||||
static const T& get_ref (const P<T>& p) {
|
||||
return pointer_traits<P<T> >::get_ref (p);}
|
||||
};
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
struct object_pointer_traits<const P<T, A1> >
|
||||
{
|
||||
typedef details::meta::yes result_type;
|
||||
typedef T object_type;
|
||||
static const T& get_ref (const P<T, A1>& p) {
|
||||
return pointer_traits<P<T, A1> >::get_ref (p);}
|
||||
};
|
||||
|
||||
inline database::
|
||||
database (database_id id)
|
||||
: id_ (id), tracer_ (0), schema_version_seq_ (1)
|
||||
{
|
||||
}
|
||||
|
||||
inline database_id database::
|
||||
id () const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
inline database::schema_version_type database::
|
||||
schema_version (const std::string& name) const
|
||||
{
|
||||
return schema_version_migration (name).version;
|
||||
}
|
||||
|
||||
inline bool database::
|
||||
schema_migration (const std::string& name) const
|
||||
{
|
||||
return schema_version_migration (name).migration;
|
||||
}
|
||||
|
||||
inline void database::
|
||||
schema_version_migration (schema_version_type v,
|
||||
bool m,
|
||||
const std::string& name)
|
||||
{
|
||||
schema_version_migration (schema_version_migration_type (v, m), name);
|
||||
}
|
||||
|
||||
inline void database::
|
||||
schema_version_table (const std::string& tname)
|
||||
{
|
||||
schema_version_table_ = tname;
|
||||
}
|
||||
|
||||
inline void database::
|
||||
schema_version_table (const std::string& tname, const std::string& sname)
|
||||
{
|
||||
schema_version_map_[sname].version_table = tname;
|
||||
}
|
||||
|
||||
inline unsigned int database::
|
||||
schema_version_sequence () const
|
||||
{
|
||||
return schema_version_seq_;
|
||||
}
|
||||
|
||||
inline connection_ptr database::
|
||||
connection ()
|
||||
{
|
||||
return connection_ptr (connection_ ());
|
||||
}
|
||||
|
||||
#ifndef ODB_CXX11
|
||||
inline void database::
|
||||
query_factory (const char* name, query_factory_ptr f)
|
||||
{
|
||||
query_factory (name, query_factory_wrapper (f));
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void database::
|
||||
tracer (tracer_type& t)
|
||||
{
|
||||
tracer_ = &t;
|
||||
}
|
||||
|
||||
inline void database::
|
||||
tracer (tracer_type* t)
|
||||
{
|
||||
tracer_ = t;
|
||||
}
|
||||
|
||||
inline database::tracer_type* database::
|
||||
tracer () const
|
||||
{
|
||||
return tracer_;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::id_type database::
|
||||
persist (T& obj)
|
||||
{
|
||||
return persist_<T, id_common> (obj);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::id_type database::
|
||||
persist (const T& obj)
|
||||
{
|
||||
return persist_<const T, id_common> (obj);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::id_type database::
|
||||
persist (T* p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
return persist_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
inline typename object_traits<T>::id_type database::
|
||||
persist (const P<T>& p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
return persist_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
inline typename object_traits<T>::id_type database::
|
||||
persist (const P<T, A1>& p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
return persist_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
inline typename object_traits<T>::id_type database::
|
||||
persist (P<T>& p)
|
||||
{
|
||||
const P<T>& cr (p);
|
||||
return persist<T, P> (cr);
|
||||
}
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
inline typename object_traits<T>::id_type database::
|
||||
persist (P<T, A1>& p)
|
||||
{
|
||||
const P<T, A1>& cr (p);
|
||||
return persist<T, A1, P> (cr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::id_type database::
|
||||
persist (const typename object_traits<T>::pointer_type& pobj)
|
||||
{
|
||||
return persist_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
inline void database::
|
||||
persist (I b, I e, bool cont)
|
||||
{
|
||||
persist_<I, id_common> (b, e, cont);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::pointer_type database::
|
||||
load (const typename object_traits<T>::id_type& id)
|
||||
{
|
||||
return load_<T, id_common> (id);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
load (const typename object_traits<T>::id_type& id, T& obj)
|
||||
{
|
||||
return load_<T, id_common> (id, obj);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
load (T& obj, section& s)
|
||||
{
|
||||
return load_<T, id_common> (obj, s);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::pointer_type database::
|
||||
find (const typename object_traits<T>::id_type& id)
|
||||
{
|
||||
return find_<T, id_common> (id);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool database::
|
||||
find (const typename object_traits<T>::id_type& id, T& obj)
|
||||
{
|
||||
return find_<T, id_common> (id, obj);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
reload (T& obj)
|
||||
{
|
||||
reload_<T, id_common> (obj);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
reload (T* p)
|
||||
{
|
||||
reload<T> (*p);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
inline void database::
|
||||
reload (const P<T>& p)
|
||||
{
|
||||
reload (odb::pointer_traits< P<T> >::get_ref (p));
|
||||
}
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
inline void database::
|
||||
reload (const P<T, A1>& p)
|
||||
{
|
||||
reload (odb::pointer_traits< P<T, A1> >::get_ref (p));
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
inline void database::
|
||||
reload (P<T>& p)
|
||||
{
|
||||
reload (odb::pointer_traits< P<T> >::get_ref (p));
|
||||
}
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
inline void database::
|
||||
reload (P<T, A1>& p)
|
||||
{
|
||||
reload (odb::pointer_traits< P<T, A1> >::get_ref (p));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
reload (const typename object_traits<T>::pointer_type& pobj)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type pointer_type;
|
||||
|
||||
reload (odb::pointer_traits<pointer_type>::get_ref (pobj));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
update (T& obj)
|
||||
{
|
||||
update_<T, id_common> (obj);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
update (T* p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
update_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
inline void database::
|
||||
update (const P<T>& p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
update_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
inline void database::
|
||||
update (const P<T, A1>& p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
update_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
inline void database::
|
||||
update (P<T>& p)
|
||||
{
|
||||
const P<T>& cr (p);
|
||||
update<T, P> (cr);
|
||||
}
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
inline void database::
|
||||
update (P<T, A1>& p)
|
||||
{
|
||||
const P<T, A1>& cr (p);
|
||||
update<T, A1, P> (cr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
update (const typename object_traits<T>::pointer_type& pobj)
|
||||
{
|
||||
update_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
inline void database::
|
||||
update (I b, I e, bool cont)
|
||||
{
|
||||
update_<I, id_common> (b, e, cont);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
update (const T& obj, const section& s)
|
||||
{
|
||||
update_<T, id_common> (obj, s);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
erase (const typename object_traits<T>::id_type& id)
|
||||
{
|
||||
return erase_<T, id_common> (id);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
erase (T& obj)
|
||||
{
|
||||
return erase_<T, id_common> (obj);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
erase (T* p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
erase_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
inline void database::
|
||||
erase (const P<T>& p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
erase_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
inline void database::
|
||||
erase (const P<T, A1>& p)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type object_pointer;
|
||||
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const object_pointer& pobj (p);
|
||||
|
||||
erase_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class P>
|
||||
inline void database::
|
||||
erase (P<T>& p)
|
||||
{
|
||||
const P<T>& cr (p);
|
||||
erase<T, P> (cr);
|
||||
}
|
||||
|
||||
template <typename T, typename A1, template <typename, typename> class P>
|
||||
inline void database::
|
||||
erase (P<T, A1>& p)
|
||||
{
|
||||
const P<T, A1>& cr (p);
|
||||
erase<T, A1, P> (cr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
erase (const typename object_traits<T>::pointer_type& pobj)
|
||||
{
|
||||
erase_<T, id_common> (pobj);
|
||||
}
|
||||
|
||||
template <typename T, typename I>
|
||||
inline void database::
|
||||
erase (I idb, I ide, bool cont)
|
||||
{
|
||||
erase_id_<I, T, id_common> (idb, ide, cont);
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
inline void database::
|
||||
erase (I ob, I oe, bool cont)
|
||||
{
|
||||
erase_object_<I, id_common> (ob, oe, cont);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline unsigned long long database::
|
||||
erase_query ()
|
||||
{
|
||||
// T is always object_type.
|
||||
//
|
||||
return erase_query<T> (odb::query<T> ());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline unsigned long long database::
|
||||
erase_query (const char* q)
|
||||
{
|
||||
// T is always object_type.
|
||||
//
|
||||
return erase_query<T> (odb::query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline unsigned long long database::
|
||||
erase_query (const std::string& q)
|
||||
{
|
||||
// T is always object_type.
|
||||
//
|
||||
return erase_query<T> (odb::query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline unsigned long long database::
|
||||
erase_query (const odb::query<T>& q)
|
||||
{
|
||||
// T is always object_type.
|
||||
//
|
||||
return object_traits_impl<T, id_common>::erase_query (*this, q);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline result<T> database::
|
||||
query (bool cache)
|
||||
{
|
||||
return query<T> (odb::query<T> (), cache);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline result<T> database::
|
||||
query (const char* q, bool cache)
|
||||
{
|
||||
return query<T> (odb::query<T> (q), cache);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline result<T> database::
|
||||
query (const std::string& q, bool cache)
|
||||
{
|
||||
return query<T> (odb::query<T> (q), cache);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::pointer_type database::
|
||||
query_one ()
|
||||
{
|
||||
return query_one<T> (odb::query<T> ());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool database::
|
||||
query_one (T& o)
|
||||
{
|
||||
return query_one<T> (odb::query<T> (), o);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T database::
|
||||
query_value ()
|
||||
{
|
||||
return query_value<T> (odb::query<T> ());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::pointer_type database::
|
||||
query_one (const char* q)
|
||||
{
|
||||
return query_one<T> (odb::query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool database::
|
||||
query_one (const char* q, T& o)
|
||||
{
|
||||
return query_one<T> (odb::query<T> (q), o);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T database::
|
||||
query_value (const char* q)
|
||||
{
|
||||
return query_value<T> (odb::query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::pointer_type database::
|
||||
query_one (const std::string& q)
|
||||
{
|
||||
return query_one<T> (odb::query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool database::
|
||||
query_one (const std::string& q, T& o)
|
||||
{
|
||||
return query_one<T> (odb::query<T> (q), o);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T database::
|
||||
query_value (const std::string& q)
|
||||
{
|
||||
return query_value<T> (odb::query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool database::
|
||||
query_one (const odb::query<T>& q, T& o)
|
||||
{
|
||||
return query_one_<T, id_common> (q, o);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename object_traits<T>::pointer_type database::
|
||||
query_one (const odb::query<T>& q)
|
||||
{
|
||||
return query_one_<T, id_common> (q);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T database::
|
||||
query_value (const odb::query<T>& q)
|
||||
{
|
||||
return query_value_<T, id_common> (q);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline prepared_query<T> database::
|
||||
prepare_query (const char* n, const char* q)
|
||||
{
|
||||
return prepare_query<T> (n, odb::query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline prepared_query<T> database::
|
||||
prepare_query (const char* n, const std::string& q)
|
||||
{
|
||||
return prepare_query<T> (n, odb::query<T> (q));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline prepared_query<T> database::
|
||||
prepare_query (const char* n, const odb::query<T>& q)
|
||||
{
|
||||
connection_type& c (transaction::current ().connection ());
|
||||
return c.prepare_query (n, q);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void database::
|
||||
cache_query (const prepared_query<T>& pq)
|
||||
{
|
||||
connection_type& c (transaction::current ().connection ());
|
||||
c.cache_query (pq);
|
||||
}
|
||||
|
||||
template <typename T, typename P>
|
||||
inline void database::
|
||||
cache_query (const prepared_query<T>& pq, std::auto_ptr<P> params)
|
||||
{
|
||||
connection_type& c (transaction::current ().connection ());
|
||||
c.cache_query (pq, params);
|
||||
}
|
||||
|
||||
#ifdef ODB_CXX11
|
||||
template <typename T, typename P>
|
||||
inline void database::
|
||||
cache_query (const prepared_query<T>& pq, std::unique_ptr<P> params)
|
||||
{
|
||||
connection_type& c (transaction::current ().connection ());
|
||||
c.cache_query (pq, std::move (params));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
inline prepared_query<T> database::
|
||||
lookup_query (const char* name) const
|
||||
{
|
||||
connection_type& c (transaction::current ().connection ());
|
||||
return c.lookup_query<T> (name);
|
||||
}
|
||||
|
||||
template <typename T, typename P>
|
||||
inline prepared_query<T> database::
|
||||
lookup_query (const char* name, P*& params) const
|
||||
{
|
||||
connection_type& c (transaction::current ().connection ());
|
||||
return c.lookup_query<T, P> (name, params);
|
||||
}
|
||||
|
||||
// Implementations (i.e., the *_() functions).
|
||||
//
|
||||
template <typename I, database_id DB>
|
||||
inline void database::
|
||||
persist_ (I b, I e, bool cont)
|
||||
{
|
||||
// Sun CC with non-standard STL does not have iterator_traits.
|
||||
//
|
||||
#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
|
||||
typedef typename std::iterator_traits<I>::value_type value_type;
|
||||
#else
|
||||
// Assume iterator is just a pointer.
|
||||
//
|
||||
typedef typename object_pointer_traits<I>::object_type value_type;
|
||||
#endif
|
||||
|
||||
typedef object_pointer_traits<value_type> opt;
|
||||
|
||||
persist_<I, typename opt::object_type, id_common> (
|
||||
b, e, cont, typename opt::result_type ());
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
inline typename object_traits<T>::pointer_type database::
|
||||
find_ (const typename object_traits<T>::id_type& id)
|
||||
{
|
||||
// T is always object_type.
|
||||
//
|
||||
|
||||
// Compiler error pointing here? Perhaps the object doesn't have the
|
||||
// default constructor?
|
||||
//
|
||||
return object_traits_impl<T, DB>::find (*this, id);
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
inline bool database::
|
||||
find_ (const typename object_traits<T>::id_type& id, T& obj)
|
||||
{
|
||||
// T is always object_type.
|
||||
//
|
||||
return object_traits_impl<T, DB>::find (*this, id, obj);
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
inline void database::
|
||||
update_ (T& obj)
|
||||
{
|
||||
// T can be const T while object_type will always be T.
|
||||
//
|
||||
typedef typename object_traits<T>::object_type object_type;
|
||||
|
||||
// Compiler error pointing here? Perhaps the object is readonly or
|
||||
// doesn't have an object id? Such objects cannot be updated.
|
||||
//
|
||||
object_traits_impl<object_type, DB>::update (*this, obj);
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
inline void database::
|
||||
update_ (const typename object_traits<T>::pointer_type& pobj)
|
||||
{
|
||||
// T can be const T while object_type will always be T.
|
||||
//
|
||||
typedef typename object_traits<T>::object_type object_type;
|
||||
typedef typename object_traits<T>::pointer_type pointer_type;
|
||||
|
||||
T& obj (pointer_traits<pointer_type>::get_ref (pobj));
|
||||
|
||||
// Compiler error pointing here? Perhaps the object is readonly or
|
||||
// doesn't have an object id? Such objects cannot be updated.
|
||||
//
|
||||
object_traits_impl<object_type, DB>::update (*this, obj);
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
inline void database::
|
||||
erase_ (const typename object_traits<T>::id_type& id)
|
||||
{
|
||||
// T is always object_type.
|
||||
//
|
||||
object_traits_impl<T, DB>::erase (*this, id);
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
inline void database::
|
||||
erase_ (T& obj)
|
||||
{
|
||||
// T can be const T while object_type will always be T.
|
||||
//
|
||||
typedef typename object_traits<T>::object_type object_type;
|
||||
|
||||
object_traits_impl<object_type, DB>::erase (*this, obj);
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
inline void database::
|
||||
erase_ (const typename object_traits<T>::pointer_type& pobj)
|
||||
{
|
||||
typedef typename object_traits<T>::pointer_type pointer_type;
|
||||
|
||||
erase_<T, DB> (pointer_traits<pointer_type>::get_ref (pobj));
|
||||
}
|
||||
|
||||
template <typename T, database_id DB, typename Q>
|
||||
inline typename object_traits<T>::pointer_type database::
|
||||
query_one_ (const Q& q)
|
||||
{
|
||||
result<T> r (query_<T, DB>::call (*this, q));
|
||||
|
||||
// We still have to cache the result since loading the object
|
||||
// may result in loading of it's related objects and that would
|
||||
// invalidate the result even for just getting the 'end' status.
|
||||
//
|
||||
r.cache ();
|
||||
|
||||
return r.one ();
|
||||
}
|
||||
|
||||
template <typename T, database_id DB, typename Q>
|
||||
inline bool database::
|
||||
query_one_ (const Q& q, T& o)
|
||||
{
|
||||
result<T> r (query_<T, DB>::call (*this, q));
|
||||
r.cache (); // See above.
|
||||
return r.one (o);
|
||||
}
|
||||
|
||||
template <typename T, database_id DB, typename Q>
|
||||
inline T database::
|
||||
query_value_ (const Q& q)
|
||||
{
|
||||
result<T> r (query_<T, DB>::call (*this, q));
|
||||
r.cache (); // See above.
|
||||
|
||||
// Compiler error pointing here? The object must be default-constructible
|
||||
// in order to use the return-by-value API.
|
||||
//
|
||||
T o;
|
||||
r.value (o);
|
||||
return o;
|
||||
}
|
||||
|
||||
// execute()
|
||||
//
|
||||
inline unsigned long long database::
|
||||
execute (const char* statement)
|
||||
{
|
||||
return execute (statement, std::strlen (statement));
|
||||
}
|
||||
|
||||
inline unsigned long long database::
|
||||
execute (const std::string& statement)
|
||||
{
|
||||
return execute (statement.c_str (), statement.size ());
|
||||
}
|
||||
}
|
||||
+492
@@ -0,0 +1,492 @@
|
||||
// file : odb/database.txx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/section.hxx>
|
||||
#include <odb/exceptions.hxx>
|
||||
#include <odb/no-op-cache-traits.hxx>
|
||||
#include <odb/pointer-traits.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
template <typename T>
|
||||
result<T> database::
|
||||
query (const odb::query<T>& q, bool cache)
|
||||
{
|
||||
// T is always object_type. We also don't need to check for transaction
|
||||
// here; object_traits::query () does this.
|
||||
//
|
||||
result<T> r (query_<T, id_common>::call (*this, q));
|
||||
|
||||
if (cache)
|
||||
r.cache ();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
// Implementations (i.e., the *_() functions).
|
||||
//
|
||||
template <typename T, database_id DB>
|
||||
typename object_traits<T>::id_type database::
|
||||
persist_ (T& obj)
|
||||
{
|
||||
// T can be const T while object_type will always be T.
|
||||
//
|
||||
typedef typename object_traits<T>::object_type object_type;
|
||||
typedef object_traits_impl<object_type, DB> object_traits;
|
||||
|
||||
object_traits::persist (*this, obj);
|
||||
|
||||
typename object_traits::reference_cache_traits::position_type p (
|
||||
object_traits::reference_cache_traits::insert (
|
||||
*this, reference_cache_type<T>::convert (obj)));
|
||||
|
||||
object_traits::reference_cache_traits::persist (p);
|
||||
|
||||
return object_traits::id (obj);
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
typename object_traits<T>::id_type database::
|
||||
persist_ (const typename object_traits<T>::pointer_type& pobj)
|
||||
{
|
||||
// T can be const T while object_type will always be T.
|
||||
//
|
||||
typedef typename object_traits<T>::object_type object_type;
|
||||
typedef typename object_traits<T>::pointer_type pointer_type;
|
||||
|
||||
typedef object_traits_impl<object_type, DB> object_traits;
|
||||
|
||||
T& obj (pointer_traits<pointer_type>::get_ref (pobj));
|
||||
object_traits::persist (*this, obj);
|
||||
|
||||
// Get the canonical object pointer and insert it into object cache.
|
||||
//
|
||||
typename object_traits::pointer_cache_traits::position_type p (
|
||||
object_traits::pointer_cache_traits::insert (
|
||||
*this, pointer_cache_type<pointer_type>::convert (pobj)));
|
||||
|
||||
object_traits::pointer_cache_traits::persist (p);
|
||||
|
||||
return object_traits::id (obj);
|
||||
}
|
||||
|
||||
template <typename T, bool = object_traits<T>::auto_id> struct persist_type;
|
||||
template <typename T> struct persist_type<T, true> {typedef T type;};
|
||||
template <typename T> struct persist_type<T, false> {typedef const T type;};
|
||||
|
||||
template <typename I, typename T, database_id DB>
|
||||
void database::
|
||||
persist_ (I b, I e, bool cont, details::meta::no /*ptr*/)
|
||||
{
|
||||
// T can be const T while object_type will always be T.
|
||||
//
|
||||
typedef typename object_traits<T>::object_type object_type;
|
||||
typedef object_traits_impl<object_type, DB> object_traits;
|
||||
|
||||
multiple_exceptions mex (typeid (object_already_persistent));
|
||||
try
|
||||
{
|
||||
while (b != e && (cont || mex.empty ()))
|
||||
{
|
||||
std::size_t n (0);
|
||||
T* a[object_traits::batch]; // T instead of persist_type for cache.
|
||||
|
||||
for (; b != e && n < object_traits::batch; ++n)
|
||||
{
|
||||
// Compiler error pointing here? Perhaps the passed range is
|
||||
// of const objects?
|
||||
//
|
||||
typename persist_type<object_type>::type* p (&(*b++));
|
||||
|
||||
a[n] = const_cast<T*> (p);
|
||||
}
|
||||
|
||||
// Compiler error pointing here? Perhaps the object or the
|
||||
// database does not support bulk operations?
|
||||
//
|
||||
object_traits::persist (
|
||||
*this,
|
||||
const_cast<typename persist_type<object_type>::type**> (a),
|
||||
n,
|
||||
mex);
|
||||
|
||||
if (mex.fatal ())
|
||||
break;
|
||||
|
||||
for (std::size_t i (0); i < n; ++i)
|
||||
{
|
||||
if (mex[i] != 0) // Don't cache objects that have failed.
|
||||
continue;
|
||||
|
||||
mex.current (i); // Set position in case the below code throws.
|
||||
|
||||
typename object_traits::reference_cache_traits::position_type p (
|
||||
object_traits::reference_cache_traits::insert (
|
||||
*this, reference_cache_type<T>::convert (*a[i])));
|
||||
|
||||
object_traits::reference_cache_traits::persist (p);
|
||||
}
|
||||
|
||||
mex.delta (n);
|
||||
}
|
||||
}
|
||||
catch (const odb::exception& ex)
|
||||
{
|
||||
mex.insert (ex, true);
|
||||
}
|
||||
|
||||
if (!mex.empty ())
|
||||
{
|
||||
mex.prepare ();
|
||||
throw mex;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
struct pointer_copy
|
||||
{
|
||||
const P* ref;
|
||||
P copy;
|
||||
|
||||
void assign (const P& p) {ref = &p;}
|
||||
template <typename P1> void assign (const P1& p1)
|
||||
{
|
||||
// The passed pointer should be the same or implicit-convertible
|
||||
// to the object pointer. This way we make sure the object pointer
|
||||
// does not assume ownership of the passed object.
|
||||
//
|
||||
const P& p (p1);
|
||||
|
||||
copy = p;
|
||||
ref = ©
|
||||
}
|
||||
};
|
||||
|
||||
template <typename I, typename T, database_id DB>
|
||||
void database::
|
||||
persist_ (I b, I e, bool cont, details::meta::yes /*ptr*/)
|
||||
{
|
||||
// T can be const T while object_type will always be T.
|
||||
//
|
||||
typedef typename object_traits<T>::object_type object_type;
|
||||
typedef typename object_traits<T>::pointer_type pointer_type;
|
||||
|
||||
typedef object_traits_impl<object_type, DB> object_traits;
|
||||
|
||||
multiple_exceptions mex (typeid (object_already_persistent));
|
||||
try
|
||||
{
|
||||
while (b != e && (cont || mex.empty ()))
|
||||
{
|
||||
std::size_t n (0);
|
||||
typename persist_type<object_type>::type* a[object_traits::batch];
|
||||
pointer_copy<pointer_type> p[object_traits::batch];
|
||||
|
||||
for (; b != e && n < object_traits::batch; ++n)
|
||||
{
|
||||
p[n].assign (*b++);
|
||||
a[n] = &pointer_traits<pointer_type>::get_ref (*p[n].ref);
|
||||
}
|
||||
|
||||
// Compiler error pointing here? Perhaps the object or the
|
||||
// database does not support bulk operations?
|
||||
//
|
||||
object_traits::persist (*this, a, n, mex);
|
||||
|
||||
if (mex.fatal ())
|
||||
break;
|
||||
|
||||
for (std::size_t i (0); i < n; ++i)
|
||||
{
|
||||
if (mex[i] != 0) // Don't cache objects that have failed.
|
||||
continue;
|
||||
|
||||
mex.current (i); // Set position in case the below code throws.
|
||||
|
||||
// Get the canonical object pointer and insert it into object cache.
|
||||
//
|
||||
typename object_traits::pointer_cache_traits::position_type pos (
|
||||
object_traits::pointer_cache_traits::insert (
|
||||
*this, pointer_cache_type<pointer_type>::convert (*p[i].ref)));
|
||||
|
||||
object_traits::pointer_cache_traits::persist (pos);
|
||||
}
|
||||
|
||||
mex.delta (n);
|
||||
}
|
||||
}
|
||||
catch (const odb::exception& ex)
|
||||
{
|
||||
mex.insert (ex, true);
|
||||
}
|
||||
|
||||
if (!mex.empty ())
|
||||
{
|
||||
mex.prepare ();
|
||||
throw mex;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
typename object_traits<T>::pointer_type database::
|
||||
load_ (const typename object_traits<T>::id_type& id)
|
||||
{
|
||||
// T is always object_type.
|
||||
//
|
||||
typedef typename object_traits<T>::pointer_type pointer_type;
|
||||
|
||||
pointer_type r (find_<T, DB> (id));
|
||||
|
||||
if (pointer_traits<pointer_type>::null_ptr (r))
|
||||
throw object_not_persistent ();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void database::
|
||||
load_ (const typename object_traits<T>::id_type& id, T& obj)
|
||||
{
|
||||
if (!find_<T, DB> (id, obj))
|
||||
throw object_not_persistent ();
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void database::
|
||||
load_ (T& obj, section& s)
|
||||
{
|
||||
connection_type& c (transaction::current ().connection ());
|
||||
|
||||
// T is always object_type.
|
||||
//
|
||||
if (object_traits_impl<T, DB>::load (c, obj, s))
|
||||
s.reset (true, false); // Loaded, unchanged.
|
||||
else
|
||||
throw section_not_in_object ();
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void database::
|
||||
reload_ (T& obj)
|
||||
{
|
||||
// T should be object_type (cannot be const). We also don't need to
|
||||
// check for transaction here; object_traits::reload () does this.
|
||||
//
|
||||
if (!object_traits_impl<T, DB>::reload (*this, obj))
|
||||
throw object_not_persistent ();
|
||||
}
|
||||
|
||||
template <typename I, database_id DB>
|
||||
void database::
|
||||
update_ (I b, I e, bool cont)
|
||||
{
|
||||
// Sun CC with non-standard STL does not have iterator_traits.
|
||||
//
|
||||
#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
|
||||
typedef typename std::iterator_traits<I>::value_type value_type;
|
||||
#else
|
||||
// Assume iterator is just a pointer.
|
||||
//
|
||||
typedef typename object_pointer_traits<I>::object_type value_type;
|
||||
#endif
|
||||
|
||||
// object_pointer_traits<T>::object_type can be const.
|
||||
//
|
||||
typedef object_pointer_traits<value_type> opt;
|
||||
|
||||
typedef
|
||||
typename object_traits<typename opt::object_type>::object_type
|
||||
object_type;
|
||||
|
||||
typedef object_traits_impl<object_type, DB> object_traits;
|
||||
|
||||
multiple_exceptions mex (
|
||||
object_traits::managed_optimistic_column_count == 0
|
||||
? typeid (object_not_persistent)
|
||||
: typeid (object_changed));
|
||||
|
||||
try
|
||||
{
|
||||
while (b != e && (cont || mex.empty ()))
|
||||
{
|
||||
std::size_t n (0);
|
||||
const object_type* a[object_traits::batch];
|
||||
|
||||
for (; b != e && n < object_traits::batch; ++n)
|
||||
a[n] = &opt::get_ref (*b++);
|
||||
|
||||
// Compiler error pointing here? Perhaps the object or the
|
||||
// database does not support bulk operations?
|
||||
//
|
||||
object_traits::update (*this, a, n, mex);
|
||||
|
||||
if (mex.fatal ())
|
||||
break;
|
||||
|
||||
mex.delta (n);
|
||||
}
|
||||
}
|
||||
catch (const odb::exception& ex)
|
||||
{
|
||||
mex.insert (ex, true);
|
||||
}
|
||||
|
||||
if (!mex.empty ())
|
||||
{
|
||||
mex.prepare ();
|
||||
throw mex;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
void database::
|
||||
update_ (const T& obj, const section& s)
|
||||
{
|
||||
if (!s.loaded ())
|
||||
throw section_not_loaded ();
|
||||
|
||||
transaction& t (transaction::current ());
|
||||
|
||||
// T is always object_type.
|
||||
//
|
||||
if (object_traits_impl<T, DB>::update (t.connection (), obj, s))
|
||||
{
|
||||
if (s.changed ())
|
||||
s.reset (true, false, &t); // Clear the change flag.
|
||||
}
|
||||
else
|
||||
throw section_not_in_object ();
|
||||
}
|
||||
|
||||
template <typename I, typename T, database_id DB>
|
||||
void database::
|
||||
erase_id_ (I b, I e, bool cont)
|
||||
{
|
||||
// T is explicitly specified by the caller, so assume it is object type.
|
||||
//
|
||||
typedef T object_type;
|
||||
typedef object_traits_impl<object_type, DB> object_traits;
|
||||
typedef typename object_traits::id_type id_type;
|
||||
|
||||
multiple_exceptions mex (typeid (object_not_persistent));
|
||||
try
|
||||
{
|
||||
while (b != e && (cont || mex.empty ()))
|
||||
{
|
||||
std::size_t n (0);
|
||||
const id_type* a[object_traits::batch];
|
||||
|
||||
for (; b != e && n < object_traits::batch; ++n)
|
||||
// Compiler error pointing here? Perhaps the object id type
|
||||
// and the range element type don't match?
|
||||
//
|
||||
a[n] = &(*b++);
|
||||
|
||||
// Compiler error pointing here? Perhaps the object or the
|
||||
// database does not support bulk operations?
|
||||
//
|
||||
object_traits::erase (*this, a, n, mex);
|
||||
|
||||
if (mex.fatal ())
|
||||
break;
|
||||
|
||||
mex.delta (n);
|
||||
}
|
||||
}
|
||||
catch (const odb::exception& ex)
|
||||
{
|
||||
mex.insert (ex, true);
|
||||
}
|
||||
|
||||
if (!mex.empty ())
|
||||
{
|
||||
mex.prepare ();
|
||||
throw mex;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename I, database_id DB>
|
||||
void database::
|
||||
erase_object_ (I b, I e, bool cont)
|
||||
{
|
||||
// Sun CC with non-standard STL does not have iterator_traits.
|
||||
//
|
||||
#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
|
||||
typedef typename std::iterator_traits<I>::value_type value_type;
|
||||
#else
|
||||
// Assume iterator is just a pointer.
|
||||
//
|
||||
typedef typename object_pointer_traits<I>::object_type value_type;
|
||||
#endif
|
||||
|
||||
// object_pointer_traits<T>::object_type can be const.
|
||||
//
|
||||
typedef object_pointer_traits<value_type> opt;
|
||||
|
||||
typedef
|
||||
typename object_traits<typename opt::object_type>::object_type
|
||||
object_type;
|
||||
|
||||
typedef object_traits_impl<object_type, DB> object_traits;
|
||||
|
||||
multiple_exceptions mex (
|
||||
object_traits::managed_optimistic_column_count == 0
|
||||
? typeid (object_not_persistent)
|
||||
: typeid (object_changed));
|
||||
|
||||
try
|
||||
{
|
||||
while (b != e && (cont || mex.empty ()))
|
||||
{
|
||||
std::size_t n (0);
|
||||
const object_type* a[object_traits::batch];
|
||||
|
||||
for (; b != e && n < object_traits::batch; ++n)
|
||||
a[n] = &opt::get_ref (*b++);
|
||||
|
||||
// Compiler error pointing here? Perhaps the object or the
|
||||
// database does not support bulk operations?
|
||||
//
|
||||
object_traits::erase (*this, a, n, mex);
|
||||
|
||||
if (mex.fatal ())
|
||||
break;
|
||||
|
||||
mex.delta (n);
|
||||
}
|
||||
}
|
||||
catch (const odb::exception& ex)
|
||||
{
|
||||
mex.insert (ex, true);
|
||||
}
|
||||
|
||||
if (!mex.empty ())
|
||||
{
|
||||
mex.prepare ();
|
||||
throw mex;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, database_id DB>
|
||||
struct database::query_<T, DB, class_object>
|
||||
{
|
||||
template <typename Q>
|
||||
static result<T>
|
||||
call (database& db, const Q& q)
|
||||
{
|
||||
return object_traits_impl<T, DB>::query (db, q);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, database_id DB>
|
||||
struct database::query_<T, DB, class_view>
|
||||
{
|
||||
template <typename Q>
|
||||
static result<T>
|
||||
call (database& db, const Q& q)
|
||||
{
|
||||
return view_traits_impl<T, DB>::query (db, q);
|
||||
}
|
||||
};
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
// file : odb/details/buffer.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <cstring> // std::memcpy
|
||||
|
||||
#include <odb/details/buffer.hxx>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
void basic_buffer_base::
|
||||
capacity (size_t c, size_t data_size)
|
||||
{
|
||||
if (c > capacity_)
|
||||
{
|
||||
size_t n (capacity_ * 2 > c ? capacity_ * 2 : c);
|
||||
void* d (operator new (n));
|
||||
|
||||
if (data_ != 0)
|
||||
{
|
||||
if (data_size != 0)
|
||||
memcpy (d, data_, data_size);
|
||||
|
||||
operator delete (data_);
|
||||
}
|
||||
|
||||
data_ = d;
|
||||
capacity_ = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
// file : odb/details/buffer.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_BUFFER_DETAILS_HXX
|
||||
#define ODB_BUFFER_DETAILS_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <new>
|
||||
#include <cstddef> // std::size_t
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
class LIBODB_EXPORT basic_buffer_base
|
||||
{
|
||||
public:
|
||||
~basic_buffer_base ()
|
||||
{
|
||||
if (data_ != 0)
|
||||
operator delete (data_);
|
||||
}
|
||||
|
||||
basic_buffer_base (std::size_t capacity)
|
||||
: capacity_ (capacity)
|
||||
{
|
||||
data_ = capacity_ == 0 ? 0 : operator new (capacity_);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
capacity () const
|
||||
{
|
||||
return capacity_;
|
||||
}
|
||||
|
||||
void
|
||||
capacity (std::size_t, std::size_t data_size = 0);
|
||||
|
||||
protected:
|
||||
void* data_;
|
||||
std::size_t capacity_;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class basic_buffer: public basic_buffer_base
|
||||
{
|
||||
public:
|
||||
basic_buffer (std::size_t capacity = 256)
|
||||
: basic_buffer_base (capacity)
|
||||
{
|
||||
}
|
||||
|
||||
T*
|
||||
data ()
|
||||
{
|
||||
return static_cast<T*> (data_);
|
||||
}
|
||||
|
||||
const T*
|
||||
data () const
|
||||
{
|
||||
return static_cast<T*> (data_);
|
||||
}
|
||||
};
|
||||
|
||||
typedef basic_buffer<char> buffer;
|
||||
typedef basic_buffer<unsigned char> ubuffer;
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_BUFFER_DETAILS_HXX
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// file : odb/details/c-string.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_C_STRING_HXX
|
||||
#define ODB_DETAILS_C_STRING_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
struct LIBODB_EXPORT c_string_comparator
|
||||
{
|
||||
bool
|
||||
operator() (const char* x, const char* y) const
|
||||
{
|
||||
return std::strcmp (x, y) < 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_C_STRING_HXX
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// file : odb/details/condition.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/condition.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
// This otherwise unnecessary file is here to allow instantiation
|
||||
// of inline functions for exporting.
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// file : odb/details/condition.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_CONDITION_HXX
|
||||
#define ODB_DETAILS_CONDITION_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/config.hxx>
|
||||
#include <odb/details/export.hxx>
|
||||
|
||||
#ifdef ODB_THREADS_NONE
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
class mutex;
|
||||
class LIBODB_EXPORT condition
|
||||
{
|
||||
public:
|
||||
condition (mutex&) {}
|
||||
|
||||
void
|
||||
signal () {}
|
||||
|
||||
void
|
||||
wait () {}
|
||||
|
||||
private:
|
||||
condition (const condition&);
|
||||
condition& operator= (const condition&);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(ODB_THREADS_POSIX)
|
||||
#include <odb/details/posix/condition.hxx>
|
||||
#elif defined(ODB_THREADS_WIN32)
|
||||
#include <odb/details/win32/condition.hxx>
|
||||
#else
|
||||
# error unknown threading model
|
||||
#endif
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_CONDITION_HXX
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/* file : odb/details/config-vc.h
|
||||
* copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
* license : GNU GPL v2; see accompanying LICENSE file
|
||||
*/
|
||||
|
||||
/* Configuration file for Windows/VC++. */
|
||||
|
||||
#ifndef ODB_DETAILS_CONFIG_VC_H
|
||||
#define ODB_DETAILS_CONFIG_VC_H
|
||||
|
||||
#define ODB_THREADS_WIN32
|
||||
#define ODB_THREADS_TLS_DECLSPEC
|
||||
|
||||
/* VC++10 and later have C++11 always enabled.
|
||||
*/
|
||||
#if _MSC_VER >= 1600
|
||||
# define ODB_CXX11
|
||||
# define ODB_CXX11_NULLPTR
|
||||
# if _MSC_VER >= 1700
|
||||
# define ODB_CXX11_ENUM
|
||||
# if _MSC_VER >= 1800
|
||||
# define ODB_CXX11_DELETED_FUNCTION
|
||||
# define ODB_CXX11_EXPLICIT_CONVERSION_OPERATOR
|
||||
# define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT
|
||||
# define ODB_CXX11_VARIADIC_TEMPLATE
|
||||
# define ODB_CXX11_INITIALIZER_LIST
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* ODB_DETAILS_CONFIG_VC_H */
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/* file : odb/details/config.h.in
|
||||
* copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
* license : GNU GPL v2; see accompanying LICENSE file
|
||||
*/
|
||||
|
||||
/* This file is automatically processed by configure. */
|
||||
|
||||
#ifndef ODB_DETAILS_CONFIG_H
|
||||
#define ODB_DETAILS_CONFIG_H
|
||||
|
||||
#undef ODB_THREADS_NONE
|
||||
#undef ODB_THREADS_POSIX
|
||||
#undef ODB_THREADS_WIN32
|
||||
#undef ODB_THREADS_TLS_KEYWORD
|
||||
#undef ODB_THREADS_TLS_DECLSPEC
|
||||
|
||||
#undef LIBODB_STATIC_LIB
|
||||
|
||||
#endif /* ODB_DETAILS_CONFIG_H */
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
// file : odb/details/config.hxx
|
||||
// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_CONFIG_HXX
|
||||
#define ODB_DETAILS_CONFIG_HXX
|
||||
|
||||
// no pre
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include <odb/details/config-vc.h>
|
||||
#elif defined(ODB_COMPILER)
|
||||
# define ODB_THREADS_NONE
|
||||
# define LIBODB_STATIC_LIB
|
||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
||||
# define ODB_CXX11
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4
|
||||
# define ODB_CXX11_NULLPTR
|
||||
# endif
|
||||
# define ODB_CXX11_DELETED_FUNCTION
|
||||
# define ODB_CXX11_EXPLICIT_CONVERSION_OPERATOR
|
||||
# define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT
|
||||
# define ODB_CXX11_VARIADIC_TEMPLATE
|
||||
# define ODB_CXX11_INITIALIZER_LIST
|
||||
# endif
|
||||
#else
|
||||
# include <odb/details/config.h>
|
||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
||||
# define ODB_CXX11
|
||||
# ifdef __GNUC__
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4
|
||||
# define ODB_CXX11_NULLPTR
|
||||
# endif
|
||||
# else
|
||||
# define ODB_CXX11_NULLPTR
|
||||
# endif
|
||||
# define ODB_CXX11_DELETED_FUNCTION
|
||||
# define ODB_CXX11_EXPLICIT_CONVERSION_OPERATOR
|
||||
# define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT
|
||||
# define ODB_CXX11_VARIADIC_TEMPLATE
|
||||
# define ODB_CXX11_INITIALIZER_LIST
|
||||
// GCC supports strongly typed enums from 4.4 (forward -- 4.6),
|
||||
// Clang -- 2.9 (3.1).
|
||||
//
|
||||
# define ODB_CXX11_ENUM
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// no post
|
||||
|
||||
#endif // ODB_DETAILS_CONFIG_HXX
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// file : odb/details/exception.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_EXCEPTION_HXX
|
||||
#define ODB_DETAILS_EXCEPTION_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/exception.hxx>
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
struct LIBODB_EXPORT exception: odb::exception
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_EXCEPTION_HXX
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
// file : odb/details/export.hxx
|
||||
// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_EXPORT_HXX
|
||||
#define ODB_DETAILS_EXPORT_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/config.hxx>
|
||||
|
||||
#ifdef LIBODB_STATIC_LIB
|
||||
# define LIBODB_EXPORT
|
||||
#else
|
||||
# ifdef _WIN32
|
||||
# ifdef _MSC_VER
|
||||
# ifdef LIBODB_DYNAMIC_LIB
|
||||
# define LIBODB_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define LIBODB_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
# else
|
||||
# ifdef LIBODB_DYNAMIC_LIB
|
||||
# ifdef DLL_EXPORT
|
||||
# define LIBODB_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define LIBODB_EXPORT
|
||||
# endif
|
||||
# else
|
||||
# define LIBODB_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# define LIBODB_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_EXPORT_HXX
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
// file : odb/details/function-wrapper.hxx
|
||||
// copyright : Copyright (c) 2009-2014 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_FUNCTION_WRAPPER_HXX
|
||||
#define ODB_DETAILS_FUNCTION_WRAPPER_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/config.hxx> // ODB_CXX11
|
||||
|
||||
#ifdef ODB_CXX11
|
||||
# include <functional> // std::function
|
||||
# include <type_traits> // std::enable_if, std::is_convertible
|
||||
#endif
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
// Low-level 'callable object' wrapper similar to std::function but
|
||||
// that works in both C++98 and 11. In particular, the call site can
|
||||
// be compiled in C++98 and the registration site in C++11 and it
|
||||
// will work.
|
||||
//
|
||||
template <typename F>
|
||||
struct function_wrapper
|
||||
{
|
||||
~function_wrapper ();
|
||||
|
||||
explicit
|
||||
function_wrapper (F* = 0);
|
||||
|
||||
#ifdef ODB_CXX11
|
||||
typedef typename std::function<F> std_function_type;
|
||||
|
||||
// This overload accepts lambdas and std::functions, but when the
|
||||
// argument is convertible to F*, then we disable it in favor of the
|
||||
// other overload (above), which is more efficient.
|
||||
//
|
||||
// Subtlety alert: if you're thinking of changing this to accept a
|
||||
// std::function<F> argument, stop. That creates an overload ambiguity
|
||||
// when the actual parameter is a lambda, which is convertible to either
|
||||
// std::function<F> or F*.
|
||||
//
|
||||
template <typename F1>
|
||||
function_wrapper(F1,
|
||||
typename std::enable_if<
|
||||
!std::is_convertible<F1, F*>::value>::type* = 0);
|
||||
#endif
|
||||
|
||||
// Destructive copy construction and assignment (aka move). These
|
||||
// should really only be called by containers when they need to
|
||||
// reallocate the underlying buffer and move the elements.
|
||||
//
|
||||
function_wrapper (const function_wrapper<F>&);
|
||||
function_wrapper&
|
||||
operator= (const function_wrapper<F>&);
|
||||
|
||||
void swap (function_wrapper<F>&);
|
||||
|
||||
// Conversion to bool.
|
||||
//
|
||||
public:
|
||||
typedef void (function_wrapper<F>::*bool_convertible) ();
|
||||
void true_value () {}
|
||||
|
||||
operator bool_convertible () const;
|
||||
|
||||
public:
|
||||
F* function;
|
||||
void (*deleter) (const void*);
|
||||
const void* std_function;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/details/function-wrapper.ixx>
|
||||
#include <odb/details/function-wrapper.txx>
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_FUNCTION_WRAPPER_HXX
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
// file : odb/details/function-wrapper.ixx
|
||||
// copyright : Copyright (c) 2009-2014 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
template <typename F>
|
||||
inline function_wrapper<F>::
|
||||
~function_wrapper ()
|
||||
{
|
||||
if (deleter != 0)
|
||||
deleter (std_function);
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline function_wrapper<F>::
|
||||
function_wrapper (F* f)
|
||||
: function (f), deleter (0), std_function (0)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline function_wrapper<F>::
|
||||
function_wrapper (const function_wrapper<F>& x)
|
||||
: function (0), deleter (0), std_function (0)
|
||||
{
|
||||
swap (const_cast<function_wrapper<F>&> (x));
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline function_wrapper<F>& function_wrapper<F>::
|
||||
operator= (const function_wrapper<F>& x)
|
||||
{
|
||||
swap (const_cast<function_wrapper<F>&> (x));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline function_wrapper<F>::
|
||||
operator bool_convertible () const
|
||||
{
|
||||
return function != 0 ? &function_wrapper<F>::true_value : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
// file : odb/details/function-wrapper.txx
|
||||
// copyright : Copyright (c) 2009-2014 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <utility> // std::swap, std::move
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
#ifdef ODB_CXX11
|
||||
template <typename F>
|
||||
struct caller_impl;
|
||||
|
||||
#ifdef ODB_CXX11_VARIADIC_TEMPLATE
|
||||
template <typename R, typename... A>
|
||||
struct caller_impl<R (A...)>
|
||||
{
|
||||
static R
|
||||
function (const void* f, A... a)
|
||||
{
|
||||
return (*static_cast<const std::function<R (A...)>*> (f)) (a...);
|
||||
}
|
||||
};
|
||||
#else
|
||||
template <typename R, typename A1>
|
||||
struct caller_impl<R (A1)>
|
||||
{
|
||||
static R
|
||||
function (const void* f, A1 a1)
|
||||
{
|
||||
return (*static_cast<const std::function<R (A1)>*> (f)) (a1);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2>
|
||||
struct caller_impl<R (A1, A2)>
|
||||
{
|
||||
static R
|
||||
function (const void* f, A1 a1, A2 a2)
|
||||
{
|
||||
return (*static_cast<const std::function<R (A1, A2)>*> (f)) (a1, a2);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename F>
|
||||
void
|
||||
deleter_impl (const void* f)
|
||||
{
|
||||
delete static_cast<const std::function<F>*> (f);
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
template <typename F1>
|
||||
function_wrapper<F>::
|
||||
function_wrapper (
|
||||
F1 f,
|
||||
typename std::enable_if<!std::is_convertible<F1, F*>::value>::type*)
|
||||
{
|
||||
std_function_type sf (std::move (f));
|
||||
|
||||
if (F* const* const f = sf.template target<F*> ())
|
||||
{
|
||||
function = *f;
|
||||
deleter = 0;
|
||||
std_function = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
function = reinterpret_cast<F*> (&caller_impl<F>::function);
|
||||
deleter = &deleter_impl<F>;
|
||||
std_function = new std_function_type (std::move (sf));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename F>
|
||||
void function_wrapper<F>::
|
||||
swap (function_wrapper<F>& x)
|
||||
{
|
||||
std::swap (function, x.function);
|
||||
std::swap (deleter, x.deleter);
|
||||
std::swap (std_function, x.std_function);
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// file : odb/details/lock.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/lock.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
// This otherwise unnecessary file is here to allow instantiation
|
||||
// of inline functions for exporting.
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
// file : odb/details/lock.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_LOCK_HXX
|
||||
#define ODB_DETAILS_LOCK_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
#include <odb/details/mutex.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
struct LIBODB_EXPORT lock
|
||||
{
|
||||
lock (mutex& m)
|
||||
: mutex_ (&m)
|
||||
{
|
||||
mutex_->lock ();
|
||||
}
|
||||
|
||||
~lock ()
|
||||
{
|
||||
if (mutex_ != 0)
|
||||
mutex_->unlock ();
|
||||
}
|
||||
|
||||
void
|
||||
unlock ()
|
||||
{
|
||||
if (mutex_ != 0)
|
||||
{
|
||||
mutex_->unlock ();
|
||||
mutex_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
mutex* mutex_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_LOCK_HXX
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// file : odb/details/meta/answer.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_META_ANSWER_HXX
|
||||
#define ODB_DETAILS_META_ANSWER_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
namespace meta
|
||||
{
|
||||
struct yes
|
||||
{
|
||||
char filling;
|
||||
};
|
||||
|
||||
struct no
|
||||
{
|
||||
char filling[2];
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_META_ANSWER_HXX
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// file : odb/details/meta/class-p.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_META_CLASS_HXX
|
||||
#define ODB_DETAILS_META_CLASS_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/meta/answer.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
namespace meta
|
||||
{
|
||||
// g++ cannot have these inside class_p.
|
||||
//
|
||||
template <typename X> no class_p_test (...);
|
||||
template <typename X> yes class_p_test (void (X::*) ());
|
||||
|
||||
template <typename X>
|
||||
struct class_p
|
||||
{
|
||||
static const bool result =
|
||||
sizeof (class_p_test<X> (0)) == sizeof (yes);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_META_CLASS_HXX
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
// file : odb/details/meta/polymorphic-p.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_META_POLYMORPHIC_HXX
|
||||
#define ODB_DETAILS_META_POLYMORPHIC_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/meta/class-p.hxx>
|
||||
#include <odb/details/meta/remove-const-volatile.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
namespace meta
|
||||
{
|
||||
template <typename CVX>
|
||||
struct polymorphic_p
|
||||
{
|
||||
typedef typename remove_const_volatile<CVX>::result X;
|
||||
|
||||
template <typename Y, bool C>
|
||||
struct impl
|
||||
{
|
||||
static const bool result = false;
|
||||
};
|
||||
|
||||
template <typename Y>
|
||||
struct impl<Y, true>
|
||||
{
|
||||
struct t1: Y
|
||||
{
|
||||
t1 ();
|
||||
};
|
||||
|
||||
struct t2: Y
|
||||
{
|
||||
t2 ();
|
||||
|
||||
virtual
|
||||
~t2 () throw ();
|
||||
};
|
||||
|
||||
static const bool result = sizeof (t1) == sizeof (t2);
|
||||
};
|
||||
|
||||
static const bool result = impl<X, class_p<X>::result>::result;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_META_POLYMORPHIC_HXX
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// file : odb/details/meta/remove-const-volatile.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_META_REMOVE_CONST_VOLATILE_HXX
|
||||
#define ODB_DETAILS_META_REMOVE_CONST_VOLATILE_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/meta/remove-const.hxx>
|
||||
#include <odb/details/meta/remove-volatile.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
namespace meta
|
||||
{
|
||||
template <typename X>
|
||||
struct remove_const_volatile
|
||||
{
|
||||
typedef
|
||||
typename remove_volatile<typename remove_const<X>::result>::result
|
||||
result;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_META_REMOVE_CONST_VOLATILE_HXX
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// file : odb/details/meta/remove-const.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_META_REMOVE_CONST_HXX
|
||||
#define ODB_DETAILS_META_REMOVE_CONST_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
namespace meta
|
||||
{
|
||||
template <typename X>
|
||||
struct remove_const
|
||||
{
|
||||
typedef X result;
|
||||
};
|
||||
|
||||
template <typename X>
|
||||
struct remove_const<const X>
|
||||
{
|
||||
typedef X result;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_META_REMOVE_CONST_HXX
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// file : odb/details/meta/remove-pointer.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_META_REMOVE_POINTER_HXX
|
||||
#define ODB_DETAILS_META_REMOVE_POINTER_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
namespace meta
|
||||
{
|
||||
template <typename X>
|
||||
struct remove_pointer
|
||||
{
|
||||
typedef X result;
|
||||
};
|
||||
|
||||
template <typename X>
|
||||
struct remove_pointer<X*>
|
||||
{
|
||||
typedef X result;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_META_REMOVE_POINTER_HXX
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// file : odb/details/meta/remove-volatile.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_META_REMOVE_VOLATILE_HXX
|
||||
#define ODB_DETAILS_META_REMOVE_VOLATILE_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
namespace meta
|
||||
{
|
||||
template <typename X>
|
||||
struct remove_volatile
|
||||
{
|
||||
typedef X result;
|
||||
};
|
||||
|
||||
template <typename X>
|
||||
struct remove_volatile<volatile X>
|
||||
{
|
||||
typedef X result;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_META_REMOVE_VOLATILE_HXX
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// file : odb/details/meta/static-assert.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_META_STATIC_ASSERT_HXX
|
||||
#define ODB_DETAILS_META_STATIC_ASSERT_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/config.hxx> // ODB_CXX11
|
||||
|
||||
#ifndef ODB_CXX11
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
namespace meta
|
||||
{
|
||||
template <bool>
|
||||
struct static_assert_test;
|
||||
|
||||
template <>
|
||||
struct static_assert_test<true> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_META_STATIC_ASSERT_HXX
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// file : odb/details/mutex.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/mutex.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
// This otherwise unnecessary file is here to allow instantiation
|
||||
// of inline functions for exporting.
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
// file : odb/details/mutex.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_MUTEX_HXX
|
||||
#define ODB_DETAILS_MUTEX_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/config.hxx>
|
||||
#include <odb/details/export.hxx>
|
||||
|
||||
#ifdef ODB_THREADS_NONE
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
class LIBODB_EXPORT mutex
|
||||
{
|
||||
public:
|
||||
mutex () {}
|
||||
|
||||
void
|
||||
lock () {}
|
||||
|
||||
void
|
||||
unlock () {}
|
||||
|
||||
private:
|
||||
mutex (const mutex&);
|
||||
mutex& operator= (const mutex&);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(ODB_THREADS_POSIX)
|
||||
#include <odb/details/posix/mutex.hxx>
|
||||
#elif defined(ODB_THREADS_WIN32)
|
||||
#include <odb/details/win32/mutex.hxx>
|
||||
#else
|
||||
# error unknown threading model
|
||||
#endif
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_MUTEX_HXX
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
// file : odb/details/posix/condition.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_POSIX_CONDITION_HXX
|
||||
#define ODB_DETAILS_POSIX_CONDITION_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
#include <odb/details/posix/mutex.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
class LIBODB_EXPORT condition
|
||||
{
|
||||
public:
|
||||
~condition ();
|
||||
condition (mutex&);
|
||||
|
||||
void
|
||||
signal ();
|
||||
|
||||
void
|
||||
wait ();
|
||||
|
||||
private:
|
||||
condition (const condition&);
|
||||
condition& operator= (const condition&);
|
||||
|
||||
private:
|
||||
mutex& mutex_;
|
||||
pthread_cond_t cond_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/details/posix/condition.ixx>
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_POSIX_CONDITION_HXX
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// file : odb/details/posix/condition.ixx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/posix/exceptions.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
inline condition::
|
||||
~condition ()
|
||||
{
|
||||
pthread_cond_destroy (&cond_);
|
||||
}
|
||||
|
||||
inline condition::
|
||||
condition (mutex& mutex)
|
||||
: mutex_ (mutex)
|
||||
{
|
||||
if (int e = pthread_cond_init (&cond_, 0))
|
||||
throw posix_exception (e);
|
||||
}
|
||||
|
||||
inline void condition::
|
||||
signal ()
|
||||
{
|
||||
if (int e = pthread_cond_signal (&cond_))
|
||||
throw posix_exception (e);
|
||||
}
|
||||
|
||||
inline void condition::
|
||||
wait ()
|
||||
{
|
||||
if (int e = pthread_cond_wait (&cond_, &mutex_.mutex_))
|
||||
throw posix_exception (e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// file : odb/details/posix/exceptions.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/posix/exceptions.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
const char* posix_exception::
|
||||
what () const throw ()
|
||||
{
|
||||
return "POSIX API error";
|
||||
}
|
||||
|
||||
posix_exception* posix_exception::
|
||||
clone () const
|
||||
{
|
||||
return new posix_exception (*this);
|
||||
}
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
// file : odb/details/posix/exceptions.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_POSIX_EXCEPTIONS_HXX
|
||||
#define ODB_DETAILS_POSIX_EXCEPTIONS_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
#include <odb/details/exception.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
struct LIBODB_EXPORT posix_exception: details::exception
|
||||
{
|
||||
posix_exception (int code) : code_ (code) {}
|
||||
|
||||
int
|
||||
code () const {return code_;}
|
||||
|
||||
virtual const char*
|
||||
what () const throw ();
|
||||
|
||||
virtual posix_exception*
|
||||
clone () const;
|
||||
|
||||
private:
|
||||
int code_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_POSIX_EXCEPTIONS_HXX
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// file : odb/details/posix/mutex.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_POSIX_MUTEX_HXX
|
||||
#define ODB_DETAILS_POSIX_MUTEX_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
class LIBODB_EXPORT mutex
|
||||
{
|
||||
public:
|
||||
~mutex ();
|
||||
mutex ();
|
||||
|
||||
void
|
||||
lock ();
|
||||
|
||||
void
|
||||
unlock ();
|
||||
|
||||
private:
|
||||
mutex (const mutex&);
|
||||
mutex& operator= (const mutex&);
|
||||
|
||||
private:
|
||||
friend class condition;
|
||||
pthread_mutex_t mutex_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/details/posix/mutex.ixx>
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_POSIX_MUTEX_HXX
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
// file : odb/details/posix/mutex.ixx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/posix/exceptions.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
inline mutex::
|
||||
~mutex ()
|
||||
{
|
||||
pthread_mutex_destroy (&mutex_);
|
||||
}
|
||||
|
||||
inline mutex::
|
||||
mutex ()
|
||||
{
|
||||
if (int e = pthread_mutex_init (&mutex_, 0))
|
||||
throw posix_exception (e);
|
||||
}
|
||||
|
||||
inline void mutex::
|
||||
lock ()
|
||||
{
|
||||
if (int e = pthread_mutex_lock (&mutex_))
|
||||
throw posix_exception (e);
|
||||
}
|
||||
|
||||
inline void mutex::
|
||||
unlock ()
|
||||
{
|
||||
if (int e = pthread_mutex_unlock (&mutex_))
|
||||
throw posix_exception (e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// file : odb/details/posix/thread.cxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/unique-ptr.hxx>
|
||||
#include <odb/details/posix/thread.hxx>
|
||||
#include <odb/details/posix/exceptions.hxx>
|
||||
|
||||
typedef void* (*thread_func) (void*);
|
||||
|
||||
struct thread_data
|
||||
{
|
||||
thread_func func;
|
||||
void* arg;
|
||||
};
|
||||
|
||||
extern "C" void*
|
||||
odb_thread_thunk (void* arg)
|
||||
{
|
||||
thread_data* data (static_cast<thread_data*> (arg));
|
||||
thread_func func = data->func;
|
||||
arg = data->arg;
|
||||
delete data;
|
||||
return func (arg);
|
||||
}
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
thread::
|
||||
thread (void* (*func) (void*), void* arg)
|
||||
: detached_ (false)
|
||||
{
|
||||
unique_ptr<thread_data> data (new thread_data);
|
||||
data->func = func;
|
||||
data->arg = arg;
|
||||
|
||||
if (int e = pthread_create (&id_, 0, &odb_thread_thunk, data.get ()))
|
||||
throw posix_exception (e);
|
||||
|
||||
data.release (); // Thread thunk will free this.
|
||||
}
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
// file : odb/details/posix/thread.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_POSIX_THREAD_HXX
|
||||
#define ODB_DETAILS_POSIX_THREAD_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include <odb/details/export.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
class LIBODB_EXPORT thread
|
||||
{
|
||||
public:
|
||||
~thread ();
|
||||
thread (void* (*thread_func) (void*), void* arg = 0);
|
||||
|
||||
void*
|
||||
join ();
|
||||
|
||||
private:
|
||||
thread (const thread&);
|
||||
thread& operator= (const thread&);
|
||||
|
||||
private:
|
||||
bool detached_;
|
||||
pthread_t id_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/details/posix/thread.ixx>
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_POSIX_THREAD_HXX
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// file : odb/details/posix/thread.ixx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/posix/exceptions.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
inline thread::
|
||||
~thread ()
|
||||
{
|
||||
if (!detached_)
|
||||
{
|
||||
if (int e = pthread_detach (id_))
|
||||
throw posix_exception (e);
|
||||
}
|
||||
}
|
||||
|
||||
inline void* thread::
|
||||
join ()
|
||||
{
|
||||
void* r;
|
||||
|
||||
if (int e = pthread_join (id_, &r))
|
||||
throw posix_exception (e);
|
||||
|
||||
detached_ = true;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
// file : odb/details/posix/tls.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_POSIX_TLS_HXX
|
||||
#define ODB_DETAILS_POSIX_TLS_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
template <typename T>
|
||||
class tls
|
||||
{
|
||||
public:
|
||||
tls ();
|
||||
|
||||
T&
|
||||
get () const;
|
||||
|
||||
void
|
||||
free ();
|
||||
|
||||
private:
|
||||
tls (const tls&);
|
||||
tls& operator= (const tls&);
|
||||
|
||||
private:
|
||||
static void
|
||||
key_init ();
|
||||
|
||||
static void
|
||||
destructor (void*);
|
||||
|
||||
private:
|
||||
static int error_;
|
||||
static pthread_once_t once_;
|
||||
static pthread_key_t key_;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class tls<T*>
|
||||
{
|
||||
public:
|
||||
tls ();
|
||||
|
||||
T*
|
||||
get () const;
|
||||
|
||||
void
|
||||
set (T* p);
|
||||
|
||||
private:
|
||||
tls (const tls&);
|
||||
tls& operator= (const tls&);
|
||||
|
||||
private:
|
||||
static void
|
||||
key_init ();
|
||||
|
||||
private:
|
||||
static int error_;
|
||||
static pthread_once_t once_;
|
||||
static pthread_key_t key_;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
inline T&
|
||||
tls_get (const tls<T>& t)
|
||||
{
|
||||
return t.get ();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void
|
||||
tls_free (tls<T>& t)
|
||||
{
|
||||
t.free ();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T*
|
||||
tls_get (const tls<T*>& t)
|
||||
{
|
||||
return t.get ();
|
||||
}
|
||||
|
||||
template <typename T, typename T1>
|
||||
inline void
|
||||
tls_set (tls<T*>& t, T1* p1)
|
||||
{
|
||||
T* p (p1);
|
||||
t.set (p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/details/posix/tls.ixx>
|
||||
#include <odb/details/posix/tls.txx>
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_POSIX_TLS_HXX
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// file : odb/details/posix/tls.ixx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
template <typename T>
|
||||
inline tls<T>::
|
||||
tls ()
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline tls<T*>::
|
||||
tls ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
// file : odb/details/posix/tls.txx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#include <odb/details/unique-ptr.hxx>
|
||||
#include <odb/details/posix/exceptions.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
// tls<T>
|
||||
//
|
||||
|
||||
template <typename T>
|
||||
int tls<T>::error_ = 0;
|
||||
|
||||
template <typename T>
|
||||
pthread_once_t tls<T>::once_ = PTHREAD_ONCE_INIT;
|
||||
|
||||
template <typename T>
|
||||
pthread_key_t tls<T>::key_;
|
||||
|
||||
template <typename T>
|
||||
T& tls<T>::
|
||||
get () const
|
||||
{
|
||||
int e (pthread_once (&once_, key_init));
|
||||
|
||||
if (e != 0 || error_ != 0)
|
||||
throw posix_exception (e ? e : error_);
|
||||
|
||||
if (void* v = pthread_getspecific (key_))
|
||||
return *static_cast<T*> (v);
|
||||
|
||||
unique_ptr<T> p (new T);
|
||||
|
||||
if ((e = pthread_setspecific (key_, p.get ())))
|
||||
throw posix_exception (e);
|
||||
|
||||
T& r (*p);
|
||||
p.release ();
|
||||
return r;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void tls<T>::
|
||||
free ()
|
||||
{
|
||||
int e (pthread_once (&once_, key_init));
|
||||
|
||||
if (e != 0 || error_ != 0)
|
||||
throw posix_exception (e ? e : error_);
|
||||
|
||||
if (void* v = pthread_getspecific (key_))
|
||||
{
|
||||
if ((e = pthread_setspecific (key_, 0)))
|
||||
throw posix_exception (e);
|
||||
|
||||
delete static_cast<T*> (v);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void tls<T>::
|
||||
key_init ()
|
||||
{
|
||||
error_ = pthread_key_create (&key_, destructor);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void tls<T>::
|
||||
destructor (void* v)
|
||||
{
|
||||
delete static_cast<T*> (v);
|
||||
}
|
||||
|
||||
// tls<T*>
|
||||
//
|
||||
|
||||
template <typename T>
|
||||
int tls<T*>::error_ = 0;
|
||||
|
||||
template <typename T>
|
||||
pthread_once_t tls<T*>::once_ = PTHREAD_ONCE_INIT;
|
||||
|
||||
template <typename T>
|
||||
pthread_key_t tls<T*>::key_;
|
||||
|
||||
template <typename T>
|
||||
T* tls<T*>::
|
||||
get () const
|
||||
{
|
||||
int e (pthread_once (&once_, key_init));
|
||||
|
||||
if (e != 0 || error_ != 0)
|
||||
throw posix_exception (e ? e : error_);
|
||||
|
||||
return static_cast<T*> (pthread_getspecific (key_));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void tls<T*>::
|
||||
set (T* p)
|
||||
{
|
||||
int e (pthread_once (&once_, key_init));
|
||||
|
||||
if (e != 0 || error_ != 0)
|
||||
throw posix_exception (e ? e : error_);
|
||||
|
||||
if ((e = pthread_setspecific (key_, p)))
|
||||
throw posix_exception (e);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void tls<T*>::
|
||||
key_init ()
|
||||
{
|
||||
error_ = pthread_key_create (&key_, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// file : odb/details/shared-ptr-fwd.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_SHARED_PTR_FWD_HXX
|
||||
#define ODB_DETAILS_SHARED_PTR_FWD_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/shared-ptr/counter-type.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
template <typename X>
|
||||
class shared_ptr;
|
||||
|
||||
class shared_base;
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_SHARED_PTR_FWD_HXX
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
// file : odb/details/shared-ptr.hxx
|
||||
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
|
||||
// license : GNU GPL v2; see accompanying LICENSE file
|
||||
|
||||
#ifndef ODB_DETAILS_SHARED_PTR_HXX
|
||||
#define ODB_DETAILS_SHARED_PTR_HXX
|
||||
|
||||
#include <odb/pre.hxx>
|
||||
|
||||
#include <odb/details/shared-ptr-fwd.hxx>
|
||||
#include <odb/details/shared-ptr/base.hxx>
|
||||
#include <odb/details/shared-ptr/exception.hxx>
|
||||
|
||||
namespace odb
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
template <typename X>
|
||||
class shared_ptr: bits::counter_ops<typename bits::counter_type<X>::r, X>
|
||||
{
|
||||
typedef bits::counter_ops<typename bits::counter_type<X>::r, X> base;
|
||||
|
||||
public:
|
||||
~shared_ptr ()
|
||||
{
|
||||
if (x_ != 0)
|
||||
base::dec (x_);
|
||||
}
|
||||
|
||||
explicit
|
||||
shared_ptr (X* x = 0)
|
||||
: base (x), x_ (x)
|
||||
{
|
||||
}
|
||||
|
||||
shared_ptr (const shared_ptr& x)
|
||||
: base (x), x_ (x.x_)
|
||||
{
|
||||
if (x_ != 0)
|
||||
base::inc (x_);
|
||||
}
|
||||
|
||||
template <typename Y>
|
||||
shared_ptr (const shared_ptr<Y>& x)
|
||||
: base (x), x_ (x.x_)
|
||||
{
|
||||
if (x_ != 0)
|
||||
base::inc (x_);
|
||||
}
|
||||
|
||||
shared_ptr&
|
||||
operator= (const shared_ptr& x)
|
||||
{
|
||||
if (x_ != x.x_)
|
||||
{
|
||||
if (x_ != 0)
|
||||
base::dec (x_);
|
||||
|
||||
static_cast<base&> (*this) = x;
|
||||
x_ = x.x_;
|
||||
|
||||
if (x_ != 0)
|
||||
base::inc (x_);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename Y>
|
||||
shared_ptr&
|
||||
operator= (const shared_ptr<Y>& x)
|
||||
{
|
||||
if (x_ != x.x_)
|
||||
{
|
||||
if (x_ != 0)
|
||||
base::dec (x_);
|
||||
|
||||
static_cast<base&> (*this) = x;
|
||||
x_ = x.x_;
|
||||
|
||||
if (x_ != 0)
|
||||
base::inc (x_);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
X*
|
||||
operator-> () const
|
||||
{
|
||||
return x_;
|
||||
}
|
||||
|
||||
X&
|
||||
operator* () const
|
||||
{
|
||||
return *x_;
|
||||
}
|
||||
|
||||
// Conversion to bool.
|
||||
//
|
||||
typedef void (shared_ptr::*boolean_convertible)();
|
||||
void true_value () {}
|
||||
|
||||
operator boolean_convertible () const
|
||||
{
|
||||
return x_ ? &shared_ptr<X>::true_value : 0;
|
||||
}
|
||||
|
||||
public:
|
||||
X*
|
||||
get () const
|
||||
{
|
||||
return x_;
|
||||
}
|
||||
|
||||
X*
|
||||
release ()
|
||||
{
|
||||
X* r (x_);
|
||||
x_ = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
reset (X* x = 0)
|
||||
{
|
||||
if (x_ != 0)
|
||||
base::dec (x_);
|
||||
|
||||
base::reset (x);
|
||||
x_ = x;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
count () const
|
||||
{
|
||||
return x_ != 0 ? base::count (x_) : 0;
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename>
|
||||
friend class shared_ptr;
|
||||
|
||||
X* x_;
|
||||
};
|
||||
|
||||
template <typename X, typename Y>
|
||||
inline bool
|
||||
operator== (const shared_ptr<X>& x, const shared_ptr<Y>& y)
|
||||
{
|
||||
return x.get () == y.get ();
|
||||
}
|
||||
|
||||
template <typename X, typename Y>
|
||||
inline bool
|
||||
operator!= (const shared_ptr<X>& x, const shared_ptr<Y>& y)
|
||||
{
|
||||
return x.get () != y.get ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <odb/post.hxx>
|
||||
|
||||
#endif // ODB_DETAILS_SHARED_PTR_HXX
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user