Commit dbc09f12 authored by Andreas Schuh's avatar Andreas Schuh

Merge remote-tracking branch 'github/cmake-migration'

parents 4328de85 13025b11
# treat all files in this repository as text files
# and normalize them to LF line endings when committed
* text
.DS_Store
CMakeCache.txt
DartConfiguration.tcl
Makefile
CMakeFiles/
/Testing/
/include/gflags/config.h
/include/gflags/gflags_completions.h
/include/gflags/gflags_declare.h
/include/gflags/gflags.h
/lib/
/test/gflags_unittest_main.cc
/test/gflags_unittest-main.cc
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
if (WIN32 AND NOT CYGWIN)
set (WINDOWS 1)
else ()
set (WINDOWS 0)
endif ()
# ----------------------------------------------------------------------------
# includes
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include (utils)
# ----------------------------------------------------------------------------
# package information
set (PROJECT_NAME "gflags")
set (PACKAGE_NAME "${PROJECT_NAME}")
set (PACKAGE_VERSION "2.1.0")
set (PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
set (PACKAGE_TARNAME "${PROJECT_NAME}-${PACKAGE_VERSION}")
set (PACKAGE_BUGREPORT "https://code.google.com/p/gflags/issues/")
project (${PROJECT_NAME} CXX)
version_numbers (
${PACKAGE_VERSION}
PACKAGE_VERSION_MAJOR
PACKAGE_VERSION_MINOR
PACKAGE_VERSION_PATCH
)
# ----------------------------------------------------------------------------
# configure options
option (BUILD_SHARED_LIBS "Request build of shared libraries." OFF)
if (WINDOWS AND BUILD_SHARED_LIBS)
set (GFLAGS_IS_A_DLL 1)
else ()
set (GFLAGS_IS_A_DLL 0)
endif ()
option (BUILD_gflags_LIB "Request build of the multi-threaded gflags library." ON)
option (BUILD_gflags_nothreads_LIB "Request build of the single-threaded gflags library." ON)
if (NOT BUILD_gflags_LIB AND NOT BUILD_gflags_nothreads_LIB)
message (FATAL_ERROR "At least one of BUILD_gflags_LIB and BUILD_gflags_nothreads_LIB must be ON.")
endif ()
option (BUILD_NEGATIVE_COMPILATION_TESTS "Request addition of negative compilation tests." OFF)
mark_as_advanced (BUILD_NEGATIVE_COMPILATION_TESTS)
set (GFLAGS_NAMESPACE "gflags" CACHE STRING "C++ namespace identifier of gflags library.")
mark_as_advanced (GFLAGS_NAMESPACE)
mark_as_advanced (CLEAR CMAKE_INSTALL_PREFIX)
mark_as_advanced (CMAKE_CONFIGURATION_TYPES)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS AND NOT CMAKE_C_FLAGS)
set (
CMAKE_BUILD_TYPE "Release"
CACHE STRING "Choose the type of build, options are: None (CMAKE_C_FLAGS and CMAKE_CXX_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
FORCE
)
endif ()
if (APPLE)
mark_as_advanced(CMAKE_OSX_ARCHITECTURES
CMAKE_OSX_DEPLOYMENT_TARGET
CMAKE_OSX_SYSROOT)
endif ()
# ----------------------------------------------------------------------------
# system checks
include (CheckTypeSize)
include (CheckIncludeFileCXX)
include (CheckCXXSymbolExists)
if (MSVC)
set (HAVE_SYS_TYPES_H 1)
set (HAVE_STDINT_H 1)
set (HAVE_STDDEF_H 1) # used by CheckTypeSize module
set (HAVE_INTTYPES_H 0)
set (HAVE_UNISTD_H 0)
set (HAVE_SYS_STAT_H 1)
check_include_file_cxx ("shlwapi.h" HAVE_SHLWAPI_H)
else ()
foreach (fname IN ITEMS unistd stdint inttypes sys/types sys/stat fnmatch)
string (TOUPPER "${fname}" FNAME)
string (REGEX REPLACE "/" "_" FNAME "${FNAME}")
if (NOT HAVE_${FNAME}_H)
check_include_file_cxx ("${fname}.h" HAVE_${FNAME}_H)
endif ()
endforeach ()
# the following are used in #if not #ifdef
bool_to_int (HAVE_STDINT_H)
bool_to_int (HAVE_SYS_TYPES_H)
bool_to_int (HAVE_INTTYPES_H)
endif ()
set (GFLAGS_INTTYPES_FORMAT "" CACHE STRING "Format of integer types: \"C99\" (uint32_t), \"BSD\" (u_int32_t), \"VC7\" (__int32)")
set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY STRINGS "C99;BSD;VC7")
mark_as_advanced (GFLAGS_INTTYPES_FORMAT)
if (NOT GFLAGS_INTTYPES_FORMAT)
set (TYPES uint32_t u_int32_t)
if (MSVC)
list (INSERT TYPES 0 __int32)
endif ()
foreach (type IN LISTS TYPES)
check_type_size (${type} ${type} LANGUAGE CXX)
if (HAVE_${type})
break ()
endif ()
endforeach ()
if (HAVE_uint32_t)
set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY VALUE C99)
elseif (HAVE_u_int32_t)
set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY VALUE BSD)
elseif (HAVE___int32)
set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY VALUE VC7)
else ()
mark_as_advanced (CLEAR GFLAGS_INTTYPES_FORMAT)
message (FATAL_ERROR "Do not know how to define a 32-bit integer quantity on your system!"
" Neither uint32_t, u_int32_t, nor __int32 seem to be available."
" Set GFLAGS_INTTYPES_FORMAT to either C99, BSD, or VC7 and try again.")
endif ()
endif ()
# use of special characters in strings to circumvent bug #0008226
if ("^${GFLAGS_INTTYPES_FORMAT}$" STREQUAL "^WIN$")
set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY VALUE VC7)
endif ()
if (NOT GFLAGS_INTTYPES_FORMAT MATCHES "^(C99|BSD|VC7)$")
message (FATAL_ERROR "Invalid value for GFLAGS_INTTYPES_FORMAT! Choose one of \"C99\", \"BSD\", or \"VC7\"")
endif ()
set (GFLAGS_INTTYPES_FORMAT_C99 0)
set (GFLAGS_INTTYPES_FORMAT_BSD 0)
set (GFLAGS_INTTYPES_FORMAT_VC7 0)
set ("GFLAGS_INTTYPES_FORMAT_${GFLAGS_INTTYPES_FORMAT}" 1)
if (MSVC)
set (HAVE_strtoll 0)
set (HAVE_strtoq 0)
else ()
check_cxx_symbol_exists (strtoll stdlib.h HAVE_STRTOLL)
if (NOT HAVE_STRTOLL)
check_cxx_symbol_exists (strtoq stdlib.h HAVE_STRTOQ)
endif ()
endif ()
set (CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package (ThreadsCXX)
if (Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
set (HAVE_PTHREAD 1)
check_type_size (pthread_rwlock_t RWLOCK LANGUAGE CXX)
else ()
set (HAVE_PTHREAD 0)
endif ()
if (UNIX AND NOT HAVE_PTHREAD AND BUILD_gflags_LIB)
if (CMAKE_HAVE_PTHREAD_H)
set (what "library")
else ()
set (what ".h file")
endif ()
message (FATAL_ERROR "Could not find pthread${what}. Check the log file"
"\n\t${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
"\nor disable the build of the multi-threaded gflags library (BUILD_gflags_LIB=OFF).")
endif ()
# ----------------------------------------------------------------------------
# source files - excluding root subdirectory and/or .in suffix
set (PUBLIC_HDRS
"gflags.h"
"gflags_declare.h"
"gflags_completions.h"
)
set (PRIVATE_HDRS
"config.h"
)
set (GFLAGS_SRCS
"gflags.cc"
"gflags_reporting.cc"
"gflags_completions.cc"
)
if (WINDOWS)
list (APPEND PRIVATE_HDRS "windows_port.h")
list (APPEND GFLAGS_SRCS "windows_port.cc")
endif ()
# ----------------------------------------------------------------------------
# configure source files
if (CMAKE_COMPILER_IS_GNUCXX)
set (GFLAGS_ATTRIBUTE_UNUSED "__attribute((unused))")
else ()
set (GFLAGS_ATTRIBUTE_UNUSED)
endif ()
configure_headers (PUBLIC_HDRS ${PUBLIC_HDRS})
configure_sources (PRIVATE_HDRS ${PRIVATE_HDRS})
configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS})
# ----------------------------------------------------------------------------
# output directories
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib")
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "lib")
# ----------------------------------------------------------------------------
# add library target
include_directories ("${PROJECT_SOURCE_DIR}/src")
include_directories ("${PROJECT_BINARY_DIR}/include")
include_directories ("${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}")
set (LIB_TARGETS)
if (BUILD_gflags_LIB)
add_library (gflags ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
list (APPEND LIB_TARGETS gflags)
endif ()
if (BUILD_gflags_nothreads_LIB)
add_library (gflags_nothreads ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
set_target_properties (gflags_nothreads PROPERTIES COMPILE_DEFINITIONS NO_THREADS)
list (APPEND LIB_TARGETS gflags_nothreads)
endif ()
# ----------------------------------------------------------------------------
# installation
if (WINDOWS)
set (RUNTIME_INSTALL_DIR Bin)
set (LIBRARY_INSTALL_DIR Lib)
set (INCLUDE_INSTALL_DIR Include)
set (CONFIG_INSTALL_DIR CMake)
else ()
set (RUNTIME_INSTALL_DIR bin)
set (LIBRARY_INSTALL_DIR lib)
set (INCLUDE_INSTALL_DIR include)
set (CONFIG_INSTALL_DIR lib/cmake/${PACKAGE_NAME})
endif ()
install (TARGETS ${LIB_TARGETS} DESTINATION ${LIBRARY_INSTALL_DIR} EXPORT gflags-lib)
install (FILES ${PUBLIC_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${GFLAGS_NAMESPACE})
file (RELATIVE_PATH INSTALL_PREFIX_REL2CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/${CONFIG_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}")
configure_file (cmake/config.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake" @ONLY)
configure_file (cmake/version.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake" @ONLY)
install (
FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake"
RENAME ${PACKAGE_NAME}-config.cmake
DESTINATION ${CONFIG_INSTALL_DIR}
)
install (
FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake"
DESTINATION ${CONFIG_INSTALL_DIR}
)
install (EXPORT gflags-lib DESTINATION ${CONFIG_INSTALL_DIR} FILE ${PACKAGE_NAME}-export.cmake)
if (UNIX)
install (PROGRAMS src/gflags_completions.sh DESTINATION ${RUNTIME_INSTALL_DIR})
endif ()
# ----------------------------------------------------------------------------
# support direct use of build tree
set (INSTALL_PREFIX_REL2CONFIG_DIR .)
export (TARGETS ${LIB_TARGETS} FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-export.cmake")
export (PACKAGE gflags)
configure_file (cmake/config.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake" @ONLY)
# ----------------------------------------------------------------------------
# testing - MUST follow the generation of the build tree config file
include (CTest)
if (BUILD_TESTING)
enable_testing ()
add_subdirectory (test)
endif ()
This diff is collapsed.
## Process this file with automake to produce Makefile.in
# Make sure that when we re-make ./configure, we get the macros we need
ACLOCAL_AMFLAGS = -I m4
# This is so we can #include <gflags/foo>
AM_CPPFLAGS = -I$(top_srcdir)/src
# This is mostly based on configure options
AM_CXXFLAGS =
# These are good warnings to turn on by default,
if GCC
AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
endif
# The -no-undefined flag allows libtool to generate shared libraries for
# Cygwin and MinGW. LIBSTDCXX_LA_LINKER_FLAG is used to fix a Solaris bug.
AM_LDFLAGS = -no-undefined $(LIBSTDCXX_LA_LINKER_FLAG)
gflagsincludedir = $(includedir)/gflags
## The .h files you want to install (that is, .h files that people
## who install this package can include in their own applications.)
gflagsinclude_HEADERS = src/gflags/gflags.h src/gflags/gflags_declare.h \
src/gflags/gflags_completions.h
# This is for backwards compatibility only.
googleincludedir = $(includedir)/google
googleinclude_HEADERS = src/google/gflags.h src/google/gflags_completions.h
bin_SCRIPTS = src/gflags_completions.sh
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
## This is for HTML and other documentation you want to install.
## Add your documentation files (in doc/) in addition to these
## top-level boilerplate files. Also add a TODO file if you have one.
dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README \
README_windows.txt doc/designstyle.css doc/gflags.html
## The libraries (.so's) you want to install
lib_LTLIBRARIES =
## The location of the windows project file for each binary we make
WINDOWS_PROJECTS = gflags.sln
## unittests you want to run when people type 'make check'.
## TESTS is for binary unittests, check_SCRIPTS for script-based unittests.
## TESTS_ENVIRONMENT sets environment variables for when you run unittest,
## but it only seems to take effect for *binary* unittests (argh!)
TESTS =
TESTS_ENVIRONMENT = SRCDIR="$(top_srcdir)"
check_SCRIPTS =
# Every time you add a unittest to check_SCRIPTS, add it here too
noinst_SCRIPTS =
# Used for auto-generated source files
CLEANFILES =
## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
GFLAGS_SOURCES = $(gflagsinclude_HEADERS) src/mutex.h src/util.h \
src/gflags.cc src/gflags_reporting.cc \
src/gflags_completions.cc
lib_LTLIBRARIES += libgflags.la
WINDOWS_PROJECTS += vsprojects/libgflags/libgflags.vcproj
libgflags_la_SOURCES = $(GFLAGS_SOURCES)
libgflags_la_CXXFLAGS = $(PTHREAD_CFLAGS) -DNDEBUG
# -version-info gets passed to libtool
libgflags_la_LDFLAGS = $(PTHREAD_CFLAGS) -version-info @SO_VERSION@
libgflags_la_LIBADD = $(PTHREAD_LIBS)
lib_LTLIBRARIES += libgflags_nothreads.la
libgflags_nothreads_la_SOURCES = $(GFLAGS_SOURCES)
libgflags_nothreads_la_CXXFLAGS = -DNDEBUG -DNO_THREADS
libgflags_nothreads_la_LDFLAGS = -version-info @SO_VERSION@
TESTS += gflags_unittest
WINDOWS_PROJECTS += vsprojects/gflags_unittest/gflags_unittest.vcproj
gflags_unittest_SOURCES = $(gflagsinclude_HEADERS) \
src/config_for_unittests.h \
src/gflags_unittest.cc
gflags_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
gflags_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
gflags_unittest_LDADD = libgflags.la
# Also make sure this works when we don't link in pthreads
TESTS += gflags_nothreads_unittest
gflags_nothreads_unittest_SOURCES = $(gflags_unittest_SOURCES)
gflags_nothreads_unittest_LDADD = libgflags_nothreads.la
# We also want to test that things work properly when the file that
# holds main() has a name ending with -main or _main. To keep the
# Makefile small :-), we test the no-threads version of these.
TESTS += gflags_unittest2
gflags_unittest2_SOURCES = $(gflagsinclude_HEADERS) \
src/gflags_unittest-main.cc
gflags_unittest2_LDADD = libgflags_nothreads.la
src/gflags_unittest-main.cc: src/gflags_unittest.cc
rm -f src/gflags_unittest-main.cc
cp -p $(top_srcdir)/src/gflags_unittest.cc src/gflags_unittest-main.cc
CLEANFILES += src/gflags_unittest-main.cc
TESTS += gflags_unittest3
gflags_unittest3_SOURCES = $(gflagsinclude_HEADERS) \
src/gflags_unittest_main.cc
gflags_unittest3_LDADD = libgflags_nothreads.la
src/gflags_unittest_main.cc: src/gflags_unittest.cc
rm -f src/gflags_unittest_main.cc
cp -p $(top_srcdir)/src/gflags_unittest.cc src/gflags_unittest_main.cc
CLEANFILES += src/gflags_unittest_main.cc
# Some buggy sh's ignore "" instead of treating it as a positional
# parameter. Since we use "" in this script, we prefer bash if we
# can. If there's no bash, we fall back to sh.
check_SCRIPTS += gflags_unittest_sh
noinst_SCRIPTS += src/gflags_unittest.sh
dist_noinst_DATA = src/gflags_unittest_flagfile
gflags_unittest_sh: gflags_unittest$(EXEEXT) \
gflags_unittest2$(EXEEXT) \
gflags_unittest3$(EXEEXT)
bash --version >/dev/null 2>&1 && export SH=bash || export SH=sh; \
$$SH "$(top_srcdir)/src/gflags_unittest.sh" \
"`pwd`/gflags_unittest" "$(top_srcdir)" "@TEST_TMPDIR@"
# Test the STRIP_FLAGS #define.
TESTS += gflags_strip_flags_test
gflags_strip_flags_test_SOURCES = $(gflagsinclude_HEADERS) \
src/config_for_unittests.h \
src/gflags_strip_flags_test.cc
gflags_strip_flags_test_CXXFLAGS = $(PTHREAD_CFLAGS)
gflags_strip_flags_test_LDFLAGS = $(PTHREAD_CFLAGS)
gflags_strip_flags_test_LDADD = libgflags.la
check_SCRIPTS += gflags_strip_flags_test_sh
noinst_SCRIPTS += src/gflags_strip_flags_test.sh
gflags_strip_flags_test_sh: gflags_strip_flags_test$(EXEEXT)
sh "$(top_srcdir)/src/gflags_strip_flags_test.sh" \
"`pwd`/gflags_strip_flags_test$(EXEEXT)"
# These are negative-compilation tests. We want to make sure these
# erroneous use of the flags macros correctly fail to compile.
# Again, we just bother testing with the no-threads version of the library.
check_SCRIPTS += gflags_nc_test1
gflags_nc_test1: $(gflagsinclude_HEADERS) src/gflags_nc.cc
if $(CXX) -DTEST_SWAPPED_ARGS $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test1.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi
check_SCRIPTS += gflags_nc_test2
gflags_nc_test2: $(gflagsinclude_HEADERS) src/gflags_nc.cc
if $(CXX) -DTEST_INT_INSTEAD_OF_BOOL $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test2.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi
check_SCRIPTS += gflags_nc_test3
gflags_nc_test3: $(gflagsinclude_HEADERS) src/gflags_nc.cc
if $(CXX) -DTEST_BOOL_IN_QUOTES $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test3.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi
# This one, on the other hand, should succeed.
check_SCRIPTS += gflags_nc_test4
gflags_nc_test4: $(gflagsinclude_HEADERS) src/gflags_nc.cc
$(CXX) -DSANITY $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test4.o $(srcdir)/src/gflags_nc.cc
# This file isn't covered under any rule that would cause it to be distributed.
dist_noinst_DATA += src/gflags_nc.cc
## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
## This should always include $(TESTS), but may also include other
## binaries that you compile but don't want automatically installed.
noinst_PROGRAMS = $(TESTS)
rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
@cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
deb: dist-gzip packages/deb.sh packages/deb/*
@cd packages && ./deb.sh ${PACKAGE} ${VERSION}
# http://linux.die.net/man/1/pkg-config, http://pkg-config.freedesktop.org/wiki
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = lib${PACKAGE}.pc lib${PACKAGE}_nothreads.pc
CLEANFILES += $(pkgconfig_DATA)
# I get the description and URL lines from the rpm spec. I use sed to
# try to rewrite exec_prefix, libdir, and includedir in terms of
# prefix, if possible.
lib${PACKAGE}.pc: Makefile packages/rpm/rpm.spec
echo 'prefix=$(prefix)' > "$@".tmp
echo 'exec_prefix='`echo '$(exec_prefix)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp
echo 'libdir='`echo '$(libdir)' | sed 's@^$(exec_prefix)@$${exec_prefix}@'` >> "$@".tmp
echo 'includedir='`echo '$(includedir)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp
echo '' >> "$@".tmp
echo 'Name: $(PACKAGE)' >> "$@".tmp
echo 'Version: $(VERSION)' >> "$@".tmp
-grep '^Summary:' $(top_srcdir)/packages/rpm/rpm.spec | sed s/^Summary:/Description:/ | head -n1 >> "$@".tmp
-grep '^URL: ' $(top_srcdir)/packages/rpm/rpm.spec >> "$@".tmp
echo 'Requires:' >> "$@".tmp
echo 'Libs: -L$${libdir} -l$(PACKAGE)' >> "$@".tmp
echo 'Libs.private: $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)' >> "$@".tmp
echo 'Cflags: -I$${includedir}' >> "$@".tmp
mv -f "$@".tmp "$@"
# The nothreads version is mostly the same
lib${PACKAGE}_nothreads.pc: lib${PACKAGE}.pc
grep -v Libs.private lib${PACKAGE}.pc | sed s/-l$(PACKAGE)/-l$(PACKAGE)_nothreads/ > "$@"
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \
libtool $(SCRIPTS) \
src/windows/config.h src/windows/port.h src/windows/port.cc \
src/windows/gflags/gflags.h src/windows/gflags/gflags_declare.h \
src/windows/gflags/gflags_completions.h \
$(WINDOWS_PROJECTS) \
src/solaris/libstdc++.la
This diff is collapsed.
This repository contains a C++ of the Google commandline flags module.
Documentation for the C++ implementation is in doc/. The python version of
gflags is now shipped seperately as it is completely independent of this
module.
This repository contains the C++ implementation of the commandline flags module
originally developed at Google. Documentation for this module is in doc/.
The python version of gflags is now a separate project.
See INSTALL for (generic) installation instructions for C++: basically
./configure && make && make install
See README_windows.txt for instructions on using under windows.
See INSTALL for (generic) installation instructions.
You can compile this under Windows, if you want. The solution file
(for VC 7.1 and later) is in this directory.
I've been told the following steps work to compile this under win64:
1) Open the provided solution file
2) Click on the Win32 target (on the right of Debug/Release)
3) Choose Configuration Manager
4) In Active Solution Platforms, choose New...
5) In "Type of select the new platform", choose x64.
In "Copy settings from:" choose Win32.
6) Ok and then Close
I don't know very much about how to install DLLs on Windows, so you'll
have to figure out that part for yourself. If you choose to just
re-use the existing .sln, make sure you set the IncludeDir's
appropriately! Look at the properties for libgflags.dll.
You can also create a static library of gflags. To do this, add
/D GFLAGS_DLL_DECL= /D GFLAGS_DLL_DECLARE_FLAG= /D GFLAGS_DLL_DEFINE_FLAG=
to the compile line of every gflags .cc file.
If you create a static library that *uses* flags (that is, DEFINEs or
DECLAREs flags), you will need to add the following to every .cc file
that defines or declares a flag (it's safe to add them to every .cc
file in your project):
/D GFLAGS_DLL_DECLARE_FLAG= /D GFLAGS_DLL_DEFINE_FLAG=
This diff is collapsed.
#!/bin/sh
# Before using, you should figure out all the .m4 macros that your
# configure.m4 script needs and make sure they exist in the m4/
# directory.
#
# These are the files that this script might edit:
# aclocal.m4 configure Makefile.in src/config.h.in \
# depcomp config.guess config.sub install-sh missing mkinstalldirs \
#
# Here's a command you can run to see what files aclocal will import:
# aclocal -I ../autoconf --output=- | sed -n 's/^m4_include..\([^]]*\).*/\1/p'
# Because libtoolize isn't in the hermetic build, autogen doesn't run it.
# However, it should be run manually periodically to update these files:
# in .: ltmain.sh
# in m4: libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4
set -ex
rm -rf autom4te.cache
aclocal --force -I m4
#grep -q LIBTOOL configure.ac && libtoolize -c -f
autoconf -f -W all,no-obsolete
autoheader -f -W all
automake -a -c -f -W all
rm -rf autom4te.cache
exit 0
This diff is collapsed.
#.rst:
# CheckLibraryExists
# ------------------
#
# Check if the function exists.
#
# CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
#
# ::
#
# LIBRARY - the name of the library you are looking for
# FUNCTION - the name of the function
# LOCATION - location where the library should be found
# VARIABLE - variable to store the result
#
#
#
# The following variables may be set before calling this macro to modify
# the way the check is run:
#
# ::
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
macro(CHECK_CXX_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$")
set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_LIBRARY_EXISTS_LIBRARIES
${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
endif()
configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists.cxx COPYONLY)
try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION}
-DLINK_DIRECTORIES:STRING=${LOCATION}
OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE})
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"passed with the following output:\n"
"${OUTPUT}\n\n")
else()
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"failed with the following output:\n"
"${OUTPUT}\n\n")
endif()
endif()
endmacro()
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
void* runner(void*);
int res = 0;
#ifdef __CLASSIC_C__
int main(){
int ac;
char*av[];
#else
int main(int ac, char*av[]){
#endif
pthread_t tid[2];
pthread_create(&tid[0], 0, runner, (void*)1);
pthread_create(&tid[1], 0, runner, (void*)2);
#if defined(__BEOS__) && !defined(__ZETA__) // (no usleep on BeOS 5.)
usleep(1); // for strange behavior on single-processor sun
#endif
pthread_join(tid[0], 0);
pthread_join(tid[1], 0);
if(ac > 1000){return *av[0];}
return res;
}
void* runner(void* args)
{
int cc;
for ( cc = 0; cc < 10; cc ++ )
{
printf("%p CC: %d\n", args, cc);
}
res ++;
return 0;
}
@headers@
#undef KEY
#if defined(__i386)
# define KEY '_','_','i','3','8','6'
#elif defined(__x86_64)
# define KEY '_','_','x','8','6','_','6','4'
#elif defined(__ppc__)
# define KEY '_','_','p','p','c','_','_'
#elif defined(__ppc64__)
# define KEY '_','_','p','p','c','6','4','_','_'
#endif
#define SIZE (sizeof(@type@))
char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
('0' + ((SIZE / 10000)%10)),
('0' + ((SIZE / 1000)%10)),
('0' + ((SIZE / 100)%10)),
('0' + ((SIZE / 10)%10)),
('0' + (SIZE % 10)),
']',
#ifdef KEY
' ','k','e','y','[', KEY, ']',
#endif
'\0'};
#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
int require = 0;
require += info_size[argc];
(void)argv;
return require;
}
# Copied from master branch of CMake (commit SHA 34a49dea) and
# modified to use CheckIncludeFileCXX instead of CheckIncludeFile
# when the LANGUAGE is CXX. Modified the try_compile call to
# not pass any LINK_LIBRARIES as this option is only supported by
# CMake since version 2.8.11
# -andreas
#.rst:
# CheckTypeSize
# -------------
#
# Check sizeof a type
#
# ::
#
# CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY]
# [LANGUAGE <language>])
#
# Check if the type exists and determine its size. On return,
# "HAVE_${VARIABLE}" holds the existence of the type, and "${VARIABLE}"
# holds one of the following:
#
# ::
#
# <size> = type has non-zero size <size>
# "0" = type has arch-dependent size (see below)
# "" = type does not exist
#
# Furthermore, the variable "${VARIABLE}_CODE" holds C preprocessor code
# to define the macro "${VARIABLE}" to the size of the type, or leave
# the macro undefined if the type does not exist.
#
# The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITECTURES has
# multiple architectures for building OS X universal binaries. This
# indicates that the type size varies across architectures. In this
# case "${VARIABLE}_CODE" contains C preprocessor tests mapping from
# each architecture macro to the corresponding type size. The list of
# architecture macros is stored in "${VARIABLE}_KEYS", and the value for
# each key is stored in "${VARIABLE}-${KEY}".
#
# If the BUILTIN_TYPES_ONLY option is not given, the macro checks for
# headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves results
# in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H. The type size
# check automatically includes the available headers, thus supporting
# checks of types defined in the headers.
#
# If LANGUAGE is set, the specified compiler will be used to perform the
# check. Acceptable values are C and CXX
#
# Despite the name of the macro you may use it to check the size of more
# complex expressions, too. To check e.g. for the size of a struct
# member you can do something like this:
#
# ::
#
# check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
#
#
#
# The following variables may be set before calling this macro to modify
# the way the check is run:
#
# ::
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
cmake_policy(PUSH)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
#-----------------------------------------------------------------------------
# Helper function. DO NOT CALL DIRECTLY.
function(__check_type_size_impl type var map builtin language)
message(STATUS "Check size of ${type}")
# Include header files.
set(headers)
if(builtin)
if(HAVE_SYS_TYPES_H)
set(headers "${headers}#include <sys/types.h>\n")
endif()
if(HAVE_STDINT_H)
set(headers "${headers}#include <stdint.h>\n")
endif()
if(HAVE_STDDEF_H)
set(headers "${headers}#include <stddef.h>\n")
endif()
endif()
foreach(h ${CMAKE_EXTRA_INCLUDE_FILES})
set(headers "${headers}#include \"${h}\"\n")
endforeach()
# Perform the check.
if("${language}" STREQUAL "C")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
elseif("${language}" STREQUAL "CXX")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
else()
message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n")
endif()
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
try_compile(HAVE_${var} ${CMAKE_BINARY_DIR} ${src}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS
"-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}"
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}"
OUTPUT_VARIABLE output
COPY_FILE ${bin}
)
if(HAVE_${var})
# The check compiled. Load information from the binary.
file(STRINGS ${bin} strings LIMIT_COUNT 10 REGEX "INFO:size")
# Parse the information strings.
set(regex_size ".*INFO:size\\[0*([^]]*)\\].*")
set(regex_key " key\\[([^]]*)\\]")
set(keys)
set(code)
set(mismatch)
set(first 1)
foreach(info ${strings})
if("${info}" MATCHES "${regex_size}")
# Get the type size.
string(REGEX REPLACE "${regex_size}" "\\1" size "${info}")
if(first)
set(${var} ${size})
elseif(NOT "${size}" STREQUAL "${${var}}")
set(mismatch 1)
endif()
set(first 0)
# Get the architecture map key.
string(REGEX MATCH "${regex_key}" key "${info}")
string(REGEX REPLACE "${regex_key}" "\\1" key "${key}")
if(key)
set(code "${code}\nset(${var}-${key} \"${size}\")")
list(APPEND keys ${key})
endif()
endif()
endforeach()
# Update the architecture-to-size map.
if(mismatch AND keys)
configure_file(${__check_type_size_dir}/CheckTypeSizeMap.cmake.in ${map} @ONLY)
set(${var} 0)
else()
file(REMOVE ${map})
endif()
if(mismatch AND NOT keys)
message(SEND_ERROR "CHECK_TYPE_SIZE found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
endif()
message(STATUS "Check size of ${type} - done")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining size of ${type} passed with the following output:\n${output}\n\n")
set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})")
else()
# The check failed to compile.
message(STATUS "Check size of ${type} - failed")
file(READ ${src} content)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown")
file(REMOVE ${map})
endif()
endfunction()
#-----------------------------------------------------------------------------
macro(CHECK_TYPE_SIZE TYPE VARIABLE)
# parse arguments
unset(doing)
foreach(arg ${ARGN})
if("x${arg}" STREQUAL "xBUILTIN_TYPES_ONLY")
set(_CHECK_TYPE_SIZE_${arg} 1)
unset(doing)
elseif("x${arg}" STREQUAL "xLANGUAGE") # change to MATCHES for more keys
set(doing "${arg}")
set(_CHECK_TYPE_SIZE_${doing} "")
elseif("x${doing}" STREQUAL "xLANGUAGE")
set(_CHECK_TYPE_SIZE_${doing} "${arg}")
unset(doing)
else()
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
endif()
endforeach()
if("x${doing}" MATCHES "^x(LANGUAGE)$")
message(FATAL_ERROR "Missing argument:\n ${doing} arguments requires a value\n")
endif()
if(DEFINED _CHECK_TYPE_SIZE_LANGUAGE)
if(NOT "x${_CHECK_TYPE_SIZE_LANGUAGE}" MATCHES "^x(C|CXX)$")
message(FATAL_ERROR "Unknown language:\n ${_CHECK_TYPE_SIZE_LANGUAGE}.\nSupported languages: C, CXX.\n")
endif()
set(_language ${_CHECK_TYPE_SIZE_LANGUAGE})
else()
set(_language C)
endif()
# Optionally check for standard headers.
if(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY)
set(_builtin 0)
else()
set(_builtin 1)
if ("x${_CHECK_TYPE_SIZE_LANGUAGE}" STREQUAL "xCXX")
check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
check_include_file_cxx(stdint.h HAVE_STDINT_H)
check_include_file_cxx(stddef.h HAVE_STDDEF_H)
else ()
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
endif ()
endif()
unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY)
unset(_CHECK_TYPE_SIZE_LANGUAGE)
# Compute or load the size or size map.
set(${VARIABLE}_KEYS)
set(_map_file ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${VARIABLE}.cmake)
if(NOT DEFINED HAVE_${VARIABLE})
__check_type_size_impl(${TYPE} ${VARIABLE} ${_map_file} ${_builtin} ${_language})
endif()
include(${_map_file} OPTIONAL)
set(_map_file)
set(_builtin)
# Create preprocessor code.
if(${VARIABLE}_KEYS)
set(${VARIABLE}_CODE)
set(_if if)
foreach(key ${${VARIABLE}_KEYS})
set(${VARIABLE}_CODE "${${VARIABLE}_CODE}#${_if} defined(${key})\n# define ${VARIABLE} ${${VARIABLE}-${key}}\n")
set(_if elif)
endforeach()
set(${VARIABLE}_CODE "${${VARIABLE}_CODE}#else\n# error ${VARIABLE} unknown\n#endif")
set(_if)
elseif(${VARIABLE})
set(${VARIABLE}_CODE "#define ${VARIABLE} ${${VARIABLE}}")
else()
set(${VARIABLE}_CODE "/* #undef ${VARIABLE} */")
endif()
endmacro()
#-----------------------------------------------------------------------------
cmake_policy(POP)
set(@var@_KEYS "@keys@")@code@
#.rst:
# FindThreads
# -----------
#
# This module determines the thread library of the system.
#
# The following variables are set
#
# ::
#
# CMAKE_THREAD_LIBS_INIT - the thread library
# CMAKE_USE_SPROC_INIT - are we using sproc?
# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
# CMAKE_USE_PTHREADS_INIT - are we using pthreads
# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
#
# For systems with multiple thread libraries, caller can set
#
# ::
#
# CMAKE_THREAD_PREFER_PTHREAD
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include (CheckIncludeFileCXX)
include (CheckCXXLibraryExists)
include (CheckCXXSymbolExists)
set(Threads_FOUND FALSE)
# Do we have sproc?
if(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
CHECK_INCLUDE_FILES_CXX("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
endif()
if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
# We have sproc
set(CMAKE_USE_SPROC_INIT 1)
else()
# Do we have pthreads?
CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H)
if(CMAKE_HAVE_PTHREAD_H)
#
# We have pthread.h
# Let's check for the library now.
#
set(CMAKE_HAVE_THREADS_LIBRARY)
if(NOT THREADS_HAVE_PTHREAD_ARG)
# Check if pthread functions are in normal C library
CHECK_CXX_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
if(CMAKE_HAVE_LIBC_CREATE)
set(CMAKE_THREAD_LIBS_INIT "")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE)
endif()
if(NOT CMAKE_HAVE_THREADS_LIBRARY)
# Do we have -lpthreads
CHECK_CXX_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
if(CMAKE_HAVE_PTHREADS_CREATE)
set(CMAKE_THREAD_LIBS_INIT "-lpthreads")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE)
endif()
# Ok, how about -lpthread
CHECK_CXX_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
if(CMAKE_HAVE_PTHREAD_CREATE)
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE)
endif()
if(CMAKE_SYSTEM MATCHES "SunOS.*")
# On sun also check for -lthread
CHECK_CXX_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
if(CMAKE_HAVE_THR_CREATE)
set(CMAKE_THREAD_LIBS_INIT "-lthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE)
endif()
endif()
endif()
endif()
if(NOT CMAKE_HAVE_THREADS_LIBRARY)
# If we did not found -lpthread, -lpthreads, or -lthread, look for -pthread
if("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
message(STATUS "Check if compiler accepts -pthread")
configure_file ("${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.cxx"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckForPthreads.cxx" COPYONLY)
try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckForPthreads.cxx
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=-pthread;-DCMAKE_CXX_FLAGS:STRING=-fpermissive"
COMPILE_OUTPUT_VARIABLE OUTPUT)
if(THREADS_HAVE_PTHREAD_ARG)
if(THREADS_PTHREAD_ARG STREQUAL "2")
set(Threads_FOUND TRUE)
message(STATUS "Check if compiler accepts -pthread - yes")
else()
message(STATUS "Check if compiler accepts -pthread - no")
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n")
endif()
else()
message(STATUS "Check if compiler accepts -pthread - no")
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
endif()
endif()
if(THREADS_HAVE_PTHREAD_ARG)
set(Threads_FOUND TRUE)
set(CMAKE_THREAD_LIBS_INIT "-pthread")
endif()
endif()
endif()
endif()
if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
set(CMAKE_USE_PTHREADS_INIT 1)
set(Threads_FOUND TRUE)
endif()
if(CMAKE_SYSTEM MATCHES "Windows")
set(CMAKE_USE_WIN32_THREADS_INIT 1)
set(Threads_FOUND TRUE)
endif()
if(CMAKE_USE_PTHREADS_INIT)
if(CMAKE_SYSTEM MATCHES "HP-UX-*")
# Use libcma if it exists and can be used. It provides more
# symbols than the plain pthread library. CMA threads
# have actually been deprecated:
# http://docs.hp.com/en/B3920-90091/ch12s03.html#d0e11395
# http://docs.hp.com/en/947/d8.html
# but we need to maintain compatibility here.
# The CMAKE_HP_PTHREADS setting actually indicates whether CMA threads
# are available.
CHECK_CXX_LIBRARY_EXISTS(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA)
if(CMAKE_HAVE_HP_CMA)
set(CMAKE_THREAD_LIBS_INIT "-lcma")
set(CMAKE_HP_PTHREADS_INIT 1)
set(Threads_FOUND TRUE)
endif()
set(CMAKE_USE_PTHREADS_INIT 1)
endif()
if(CMAKE_SYSTEM MATCHES "OSF1-V*")
set(CMAKE_USE_PTHREADS_INIT 0)
set(CMAKE_THREAD_LIBS_INIT )
endif()
if(CMAKE_SYSTEM MATCHES "CYGWIN_NT*")
set(CMAKE_USE_PTHREADS_INIT 1)
set(Threads_FOUND TRUE)
set(CMAKE_THREAD_LIBS_INIT )
set(CMAKE_USE_WIN32_THREADS_INIT 0)
endif()
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)
## gflags CMake configuration file
# library version information
set (@PACKAGE_NAME@_VERSION_STRING "@PACKAGE_VERSION@")
set (@PACKAGE_NAME@_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@)
set (@PACKAGE_NAME@_VERSION_MINOR @PACKAGE_VERSION_MINOR@)
set (@PACKAGE_NAME@_VERSION_PATCH @PACKAGE_VERSION_PATCH@)
# import targets
include ("${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_NAME@-export.cmake")
# installation prefix
get_filename_component (CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component (_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PREFIX_REL2CONFIG_DIR@" ABSOLUTE)
# include directory
set (@PACKAGE_NAME@_INCLUDE_DIR "${_INSTALL_PREFIX}/@INCLUDE_INSTALL_DIR@")
# gflags library
set (@PACKAGE_NAME@_LIBRARIES gflags)
# unset private variables
unset (_INSTALL_PREFIX)
# ----------------------------------------------------------------------------
# sanitize string stored in variable for use in regular expression.
macro (sanitize_for_regex STRVAR)
string (REGEX REPLACE "([.+*?^$()])" "\\\\\\1" ${STRVAR} "${${STRVAR}}")
endmacro ()
# ----------------------------------------------------------------------------
# script arguments
if (NOT COMMAND)
message (FATAL_ERROR "Test command not specified!")
endif ()
if (NOT DEFINED EXPECTED_RC)
set (EXPECTED_RC 0)
endif ()
if (EXPECTED_OUTPUT)
sanitize_for_regex(EXPECTED_OUTPUT)
endif ()
if (UNEXPECTED_OUTPUT)
sanitize_for_regex(UNEXPECTED_OUTPUT)
endif ()
# ----------------------------------------------------------------------------
# set a few environment variables (useful for --tryfromenv)
set (ENV{FLAGS_undefok} "foo,bar")
set (ENV{FLAGS_weirdo} "")
set (ENV{FLAGS_version} "true")
set (ENV{FLAGS_help} "false")
# ----------------------------------------------------------------------------
# execute test command
execute_process(
COMMAND ${COMMAND}
RESULT_VARIABLE RC
OUTPUT_VARIABLE OUTPUT
ERROR_VARIABLE OUTPUT
)
if (OUTPUT)
message ("${OUTPUT}")
endif ()
# ----------------------------------------------------------------------------
# check test result
if (NOT RC EQUAL EXPECTED_RC)
string (REPLACE ";" " " COMMAND "${COMMAND}")
message (FATAL_ERROR "Command:\n\t${COMMAND}\nExit status is ${RC}, expected ${EXPECTED_RC}")
endif ()
if (EXPECTED_OUTPUT AND NOT OUTPUT MATCHES "${EXPECTED_OUTPUT}")
message (FATAL_ERROR "Test output does not match expected output: ${EXPECTED_OUTPUT}")
endif ()
if (UNEXPECTED_OUTPUT AND OUTPUT MATCHES "${UNEXPECTED_OUTPUT}")
message (FATAL_ERROR "Test output matches unexpected output: ${UNEXPECTED_OUTPUT}")
endif ()
\ No newline at end of file
## Utility CMake functions.
# ----------------------------------------------------------------------------
## Convert boolean value to 0 or 1
macro (bool_to_int VAR)
if (${VAR})
set (${VAR} 1)
else ()
set (${VAR} 0)
endif ()
endmacro ()
# ----------------------------------------------------------------------------
## Extract version numbers from version string.
function (version_numbers version major minor patch)
if (version MATCHES "([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?(rc[1-9][0-9]*|[a-z]+)?")
if (CMAKE_MATCH_1)
set (_major ${CMAKE_MATCH_1})
else ()
set (_major 0)
endif ()
if (CMAKE_MATCH_2)
set (_minor ${CMAKE_MATCH_2})
string (REGEX REPLACE "^\\." "" _minor "${_minor}")
else ()
set (_minor 0)
endif ()
if (CMAKE_MATCH_3)
set (_patch ${CMAKE_MATCH_3})
string (REGEX REPLACE "^\\." "" _patch "${_patch}")
else ()
set (_patch 0)
endif ()
else ()
set (_major 0)
set (_minor 0)
set (_patch 0)
endif ()
set ("${major}" "${_major}" PARENT_SCOPE)
set ("${minor}" "${_minor}" PARENT_SCOPE)
set ("${patch}" "${_patch}" PARENT_SCOPE)
endfunction ()
# ----------------------------------------------------------------------------
## Configure public header files
function (configure_headers out)
set (tmp)
foreach (src IN LISTS ARGN)
if (EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in")
configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" @ONLY)
list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}")
else ()
configure_file ("${PROJECT_SOURCE_DIR}/src/${src}" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" COPYONLY)
list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}")
endif ()
endforeach ()
set (${out} "${tmp}" PARENT_SCOPE)
endfunction ()
# ----------------------------------------------------------------------------
## Configure source files with .in suffix
function (configure_sources out)
set (tmp)
foreach (src IN LISTS ARGN)
if (src MATCHES ".h$" AND EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in")
configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" @ONLY)
list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}")
else ()
list (APPEND tmp "${PROJECT_SOURCE_DIR}/src/${src}")
endif ()
endforeach ()
set (${out} "${tmp}" PARENT_SCOPE)
endfunction ()
# ----------------------------------------------------------------------------
## Add usage test
#
# Using PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION would
# do as well, but CMake/CTest does not allow us to specify an
# expected exit status. Moreover, the execute_test.cmake script
# sets environment variables needed by the --fromenv/--tryfromenv tests.
macro (add_gflags_test name expected_rc expected_output unexpected_output cmd)
set (args "--test_tmpdir=${PROJECT_BINARY_DIR}/Testing/Temporary"
"--srcdir=${PROJECT_SOURCE_DIR}/test")
add_test (
NAME ${name}
COMMAND "${CMAKE_COMMAND}" "-DCOMMAND:STRING=$<TARGET_FILE:${cmd}>;${args};${ARGN}"
"-DEXPECTED_RC:STRING=${expected_rc}"
"-DEXPECTED_OUTPUT:STRING=${expected_output}"
"-DUNEXPECTED_OUTPUT:STRING=${unexpected_output}"
-P "${PROJECT_SOURCE_DIR}/cmake/execute_test.cmake"
WORKING_DIRECTORY "${GFLAGS_FLAGFILES_DIR}"
)
endmacro ()
## gflags CMake configuration version file
# -----------------------------------------------------------------------------
# library version
set (PACKAGE_VERSION "@PACKAGE_VERSION@")
# -----------------------------------------------------------------------------
# check compatibility
# Perform compatibility check here using the input CMake variables.
# See example in http://www.cmake.org/Wiki/CMake_2.6_Notes.
set (PACKAGE_VERSION_COMPATIBLE TRUE)
set (PACKAGE_VERSION_UNSUITABLE FALSE)
if ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@PACKAGE_VERSION_MAJOR@" AND
"${PACKAGE_FIND_VERSION_MINOR}" EQUAL "@PACKAGE_VERSION_MINOR@")
set (PACKAGE_VERSION_EXACT TRUE)
else ()
set (PACKAGE_VERSION_EXACT FALSE)
endif ()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
## Process this file with autoconf to produce configure.
## In general, the safest way to proceed is to run ./autogen.sh
# make sure we're interpreted by some minimal autoconf
AC_PREREQ(2.57)
AC_INIT(gflags, 2.0, google-gflags@googlegroups.com)
# Update this value for every release! (A:B:C will map to foo.so.(A-C).C.B)
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
SO_VERSION=3:0:1
# The argument here is just something that should be in the current directory
# (for sanity checking)
AC_CONFIG_SRCDIR(README)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([dist-zip])
AM_CONFIG_HEADER(src/config.h)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
AC_CANONICAL_HOST
# MinGW uses autoconf, but also needs the windows shim routines
# (since it doesn't have its own support for, say, pthreads).
# This requires us to #include a special header file, and also to
# link in some windows versions of .o's instead of the unix versions.
AH_BOTTOM([
#if defined( __MINGW32__) || defined(__MINGW64__)
#include "windows/port.h"
#endif
])
# Populate $host_cpu, $host_os, etc.
AC_CANONICAL_HOST
case $host_os in
*mingw*)
# Disabling fast install keeps libtool from creating wrapper scripts
# around the executables it builds. Such scripts have caused failures on
# MinGW. Using this option means an extra link step is executed during
# "make install".
AC_DISABLE_FAST_INSTALL
# /tmp is a mount-point in mingw, and hard to use. use cwd instead
TEST_TMPDIR=gflags_testdir
;;
*)
AC_ENABLE_FAST_INSTALL
TEST_TMPDIR=/tmp/gflags
;;
esac
AC_SUBST(TEST_TMPDIR)
# Uncomment this if you'll be exporting libraries (.so's)
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(SO_VERSION)
# Check whether some low-level functions/files are available
AC_HEADER_STDC
# These are tested for by AC_HEADER_STDC, but I check again to set the var
AC_CHECK_HEADER(stdint.h, ac_cv_have_stdint_h=1, ac_cv_have_stdint_h=0)
AC_CHECK_HEADER(sys/types.h, ac_cv_have_systypes_h=1, ac_cv_have_systypes_h=0)
AC_CHECK_HEADER(inttypes.h, ac_cv_have_inttypes_h=1, ac_cv_have_inttypes_h=0)
AC_CHECK_HEADERS([fnmatch.h])
AC_CHECK_HEADERS([sys/stat.h])
AC_CHECK_HEADERS([unistd.h])
# These are the types I need. We look for them in either stdint.h,
# sys/types.h, or inttypes.h, all of which are part of the default-includes.
AC_CHECK_TYPE(uint16_t, ac_cv_have_uint16_t=1, ac_cv_have_uint16_t=0)
AC_CHECK_TYPE(u_int16_t, ac_cv_have_u_int16_t=1, ac_cv_have_u_int16_t=0)
AC_CHECK_TYPE(__int16, ac_cv_have___int16=1, ac_cv_have___int16=0)
AC_CHECK_FUNCS([strtoll strtoq])
AX_C___ATTRIBUTE__
# We only care about __attribute__ ((unused))
if test x"$ac_cv___attribute__" = x"yes"; then
ac_cv___attribute__unused="__attribute__ ((unused))"
else
ac_cv___attribute__unused=
fi
ACX_PTHREAD
# Find out what namespace 'normal' STL code lives in, and also what namespace
# the user wants our classes to be defined in
AC_CXX_STL_NAMESPACE
# TODO(csilvers): this should be renamed to gflags.
AC_DEFINE_GOOGLE_NAMESPACE(google)
# Solaris 10 6/06 has a bug where /usr/sfw/lib/libstdc++.la is empty.
# If so, we replace it with our own version.
LIBSTDCXX_LA_LINKER_FLAG=
if test -f /usr/sfw/lib/libstdc++.la && ! test -s /usr/sfw/lib/libstdc++.la
then
LIBSTDCXX_LA_LINKER_FLAG='-L$(top_srcdir)/src/solaris'
fi
AC_SUBST(LIBSTDCXX_LA_LINKER_FLAG)
# These are what's needed by gflags.h.in
AC_SUBST(ac_google_start_namespace)
AC_SUBST(ac_google_end_namespace)
AC_SUBST(ac_google_namespace)
AC_SUBST(ac_cv___attribute__unused)
AC_SUBST(ac_cv_have_stdint_h)
AC_SUBST(ac_cv_have_systypes_h)
AC_SUBST(ac_cv_have_inttypes_h)
AC_SUBST(ac_cv_have_uint16_t)
AC_SUBST(ac_cv_have_u_int16_t)
AC_SUBST(ac_cv_have___int16)
## Check out ../autoconf/ for other macros you can call to do useful stuff
# For windows, this has a non-trivial value (__declspec(export)), but any
# system that uses configure wants this to be the empty string.
AC_DEFINE(GFLAGS_DLL_DECL,,
[Always the empty-string on non-windows systems.
On windows, should be "__declspec(dllexport)".
This way, when we compile the dll, we export our functions/classes.
It's safe to define this here because config.h is only used
internally, to compile the DLL, and every DLL source file
#includes "config.h" before anything else.])
# Write generated configuration file, and also .h files
AC_CONFIG_FILES([Makefile
src/gflags/gflags.h src/gflags/gflags_declare.h
src/gflags/gflags_completions.h])
AC_OUTPUT
This diff is collapsed.
......@@ -26,7 +26,7 @@
<body>
<h1>How To Use Gflags (formerly Google Commandline Flags)</h1>
<h1>How To Use gflags (formerly Google Commandline Flags)</h1>
<small>(as of
<script type=text/javascript>
var lm = new Date(document.lastModified);
......@@ -38,6 +38,7 @@
<blockquote><dl>
<dt> Table of contents </dt>
<dd> <a href="#intro">Introduction</a> </dd>
<dd> <a href="#cmake">Finding and Linking to gflags using CMake</a></dd>
<dd> <a href="#define">DEFINE: Defining Flags In Program</A> </dd>
<dd> <a href="#using">Accessing the Flag</A> </dd>
<dd> <a href="#declare">DECLARE: Using the Flag in a Different File</a> </dd>
......@@ -90,6 +91,17 @@ library. It's a C++ library, so examples are in C++. However, there
is a Python port with the same functionality, and this discussion
translates directly to Python.</p>
<h2> <A name=cmake>Finding and Linking to gflags </A> using CMake</h2>
<p> Using gflags within a project which uses <A href="http://www.cmake.org">CMake</A> for its build system is easy. Therefore, simply add the following CMake code to your <code>CMakeLists.txt</code> file.
<pre>
find_package (gflags REQUIRED)
include_directories (${gflags_INCLUDE_DIR})
add_executable (foo main.cc)
target_link_libraries (foo gflags)
</pre>
<h2> <A name=define>DEFINE: Defining Flags In Program</A> </h2>
......@@ -535,7 +547,7 @@ useful for security reasons.</p>
<hr>
<address>
Craig Silverstein<br>
Craig Silverstein, Andreas Schuh<br>
<script type=text/javascript>
var lm = new Date(document.lastModified);
document.write(lm.toDateString());
......
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgflags", "vsprojects\libgflags\libgflags-vs2003.vcproj", "{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gflags_unittest", "vsprojects\gflags_unittest\gflags_unittest-vs2003.vcproj", "{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}"
ProjectSection(ProjectDependencies) = postProject
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC} = {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug.ActiveCfg = Debug|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug.Build.0 = Debug|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release.ActiveCfg = Release|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release.Build.0 = Release|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug.ActiveCfg = Debug|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug.Build.0 = Debug|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release.ActiveCfg = Release|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgflags", "vsprojects\libgflags\libgflags-vs2010.vcxproj", "{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gflags_unittest", "vsprojects\gflags_unittest\gflags_unittest-vs2010.vcxproj", "{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug|Win32.ActiveCfg = Debug|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug|Win32.Build.0 = Debug|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release|Win32.ActiveCfg = Release|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release|Win32.Build.0 = Release|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug|Win32.ActiveCfg = Debug|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug|Win32.Build.0 = Debug|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release|Win32.ActiveCfg = Release|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgflags", "vsprojects\libgflags\libgflags-vs2012.vcxproj", "{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gflags_unittest", "vsprojects\gflags_unittest\gflags_unittest-vs2012.vcxproj", "{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug|Win32.ActiveCfg = Debug|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug|Win32.Build.0 = Debug|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release|Win32.ActiveCfg = Release|Win32
{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release|Win32.Build.0 = Release|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug|Win32.ActiveCfg = Debug|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug|Win32.Build.0 = Debug|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release|Win32.ActiveCfg = Release|Win32
{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
This diff is collapsed.
AC_DEFUN([AX_C___ATTRIBUTE__], [
AC_MSG_CHECKING(for __attribute__)
AC_CACHE_VAL(ac_cv___attribute__, [
AC_TRY_COMPILE(
[#include <stdlib.h>
static void foo(void) __attribute__ ((unused));
void foo(void) { exit(1); }],
[],
ac_cv___attribute__=yes,
ac_cv___attribute__=no
)])
if test "$ac_cv___attribute__" = "yes"; then
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
fi
AC_MSG_RESULT($ac_cv___attribute__)
])
This diff is collapsed.
# Allow users to override the namespace we define our application's classes in
# Arg $1 is the default namespace to use if --enable-namespace isn't present.
# In general, $1 should be 'google', so we put all our exported symbols in a
# unique namespace that is not likely to conflict with anyone else. However,
# when it makes sense -- for instance, when publishing stl-like code -- you
# may want to go with a different default, like 'std'.
# We guarantee the invariant that GOOGLE_NAMESPACE starts with ::,
# unless it's the empty string. Thus, it's always safe to do
# GOOGLE_NAMESPACE::foo and be sure you're getting the foo that's
# actually in the google namespace, and not some other namespace that
# the namespace rules might kick in.
AC_DEFUN([AC_DEFINE_GOOGLE_NAMESPACE],
[google_namespace_default=[$1]
AC_ARG_ENABLE(namespace, [ --enable-namespace=FOO to define these Google
classes in the FOO namespace. --disable-namespace
to define them in the global namespace. Default
is to define them in namespace $1.],
[case "$enableval" in
yes) google_namespace="$google_namespace_default" ;;
no) google_namespace="" ;;
*) google_namespace="$enableval" ;;
esac],
[google_namespace="$google_namespace_default"])
if test -n "$google_namespace"; then
ac_google_namespace="::$google_namespace"
ac_google_start_namespace="namespace $google_namespace {"
ac_google_end_namespace="}"
else
ac_google_namespace=""
ac_google_start_namespace=""
ac_google_end_namespace=""
fi
AC_DEFINE_UNQUOTED(GOOGLE_NAMESPACE, $ac_google_namespace,
Namespace for Google classes)
AC_DEFINE_UNQUOTED(_START_GOOGLE_NAMESPACE_, $ac_google_start_namespace,
Puts following code inside the Google namespace)
AC_DEFINE_UNQUOTED(_END_GOOGLE_NAMESPACE_, $ac_google_end_namespace,
Stops putting the code inside the Google namespace)
])
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# 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.
# Generated from ltversion.in.
# serial 3017 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.2.6b])
m4_define([LT_PACKAGE_REVISION], [1.3017])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.2.6b'
macro_revision='1.3017'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
AUTHORS
COPYING
ChangeLog
INSTALL
NEWS
README
doc/designstyle.css
doc/gflags.html
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--version
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment