diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 43de4c9d4..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,58 +0,0 @@ -# How to contribute # - -We'd love to accept your patches and contributions to this project. There are -a just a few small guidelines you need to follow. - - -## Contributor License Agreement ## - -Contributions to any Google project must be accompanied by a Contributor -License Agreement. This is not a copyright **assignment**, it simply gives -Google permission to use and redistribute your contributions as part of the -project. - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual - CLA][]. - - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA][]. - -You generally only need to submit a CLA once, so if you've already submitted -one (even if it was for a different project), you probably don't need to do it -again. - -[individual CLA]: https://developers.google.com/open-source/cla/individual -[corporate CLA]: https://developers.google.com/open-source/cla/corporate - -Once your CLA is submitted (or if you already submitted one for -another Google project), make a commit adding yourself to the -[AUTHORS][] and [CONTRIBUTORS][] files. This commit can be part -of your first [pull request][]. - -[AUTHORS]: AUTHORS -[CONTRIBUTORS]: CONTRIBUTORS - - -## Submitting a patch ## - - 1. It's generally best to start by opening a new issue describing the bug or - feature you're intending to fix. Even if you think it's relatively minor, - it's helpful to know what people are working on. Mention in the initial - issue that you are planning to work on that bug or feature so that it can - be assigned to you. - - 1. Follow the normal process of [forking][] the project, and setup a new - branch to work in. It's important that each group of changes be done in - separate branches in order to ensure that a pull request only includes the - commits related to that bug or feature. - - 1. Do your best to have [well-formed commit messages][] for each change. - This provides consistency throughout the project, and ensures that commit - messages are able to be formatted properly by various git tools. - - 1. Finally, push the commits to your fork and submit a [pull request][]. - -[forking]: https://help.github.com/articles/fork-a-repo -[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html -[pull request]: https://help.github.com/articles/creating-a-pull-request diff --git a/INSTALL b/INSTALL deleted file mode 100644 index e9530ac08..000000000 --- a/INSTALL +++ /dev/null @@ -1,313 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007 Free Software Foundation, Inc. - -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Glog-Specific Install Notes -================================ - -*** NOTE FOR 64-BIT LINUX SYSTEMS - -The glibc built-in stack-unwinder on 64-bit systems has some problems -with the glog libraries. (In particular, if you are using -InstallFailureSignalHandler(), the signal may be raised in the middle -of malloc, holding some malloc-related locks when they invoke the -stack unwinder. The built-in stack unwinder may call malloc -recursively, which may require the thread to acquire a lock it already -holds: deadlock.) - -For that reason, if you use a 64-bit system and you need -InstallFailureSignalHandler(), we strongly recommend you install -libunwind before trying to configure or install google glog. -libunwind can be found at - - http://download.savannah.nongnu.org/releases/libunwind/libunwind-snap-070410.tar.gz - -Even if you already have libunwind installed, you will probably still -need to install from the snapshot to get the latest version. - -CAUTION: if you install libunwind from the URL above, be aware that -you may have trouble if you try to statically link your binary with -glog: that is, if you link with 'gcc -static -lgcc_eh ...'. This -is because both libunwind and libgcc implement the same C++ exception -handling APIs, but they implement them differently on some platforms. -This is not likely to be a problem on ia64, but may be on x86-64. - -Also, if you link binaries statically, make sure that you add --Wl,--eh-frame-hdr to your linker options. This is required so that -libunwind can find the information generated by the compiler required -for stack unwinding. - -Using -static is rare, though, so unless you know this will affect you -it probably won't. - -If you cannot or do not wish to install libunwind, you can still try -to use two kinds of stack-unwinder: 1. glibc built-in stack-unwinder -and 2. frame pointer based stack-unwinder. - -1. As we already mentioned, glibc's unwinder has a deadlock issue. -However, if you don't use InstallFailureSignalHandler() or you don't -worry about the rare possibilities of deadlocks, you can use this -stack-unwinder. If you specify no options and libunwind isn't -detected on your system, the configure script chooses this unwinder by -default. - -2. The frame pointer based stack unwinder requires that your -application, the glog library, and system libraries like libc, all be -compiled with a frame pointer. This is *not* the default for x86-64. - -If you are on x86-64 system, know that you have a set of system -libraries with frame-pointers enabled, and compile all your -applications with -fno-omit-frame-pointer, then you can enable the -frame pointer based stack unwinder by passing the ---enable-frame-pointers flag to configure. - - -Basic Installation -================== - -Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README.md' file for -instructions specific to this package. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README.md' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 6. Often, you can also type `make uninstall' to remove the installed - files again. - - -Building glog - Using vcpkg -=========================== - -The url of vcpkg is: https://github.com/Microsoft/vcpkg -You can download and install glog using the vcpkg dependency manager: - - git clone https://github.com/Microsoft/vcpkg.git - cd vcpkg - ./bootstrap-vcpkg.sh - ./vcpkg integrate install - ./vcpkg install glog - -The glog port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository. - - -Compilers and Options -===================== - -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - -You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - -Installation Names -================== - -By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - -Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README.md' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - -Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - -`configure' recognizes the following options to control how it operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index e792332a0..000000000 --- a/Makefile.am +++ /dev/null @@ -1,259 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = subdir-objects foreign - -# Make sure that when we re-make ./configure, we get the macros we need -ACLOCAL_AMFLAGS = -I m4 - -# This is so we can #include -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 - -# These are x86-specific, having to do with frame-pointers -if X86_64 -if ENABLE_FRAME_POINTERS - AM_CXXFLAGS += -fno-omit-frame-pointer -else - # TODO(csilvers): check if -fomit-frame-pointer might be in $(CXXFLAGS), - # before setting this. - AM_CXXFLAGS += -DNO_FRAME_POINTER -endif -endif - -if DISABLE_RTTI - AM_CXXFLAGS += -fno-rtti -endif - -glogincludedir = $(includedir)/glog -## The .h files you want to install (that is, .h files that people -## who install this package can include in their own applications.) -## We have to include both the .h and .h.in forms. The latter we -## put in noinst_HEADERS. -gloginclude_HEADERS = src/glog/log_severity.h -nodist_gloginclude_HEADERS = src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h -noinst_HEADERS = src/glog/logging.h.in src/glog/raw_logging.h.in src/glog/vlog_is_on.h.in src/glog/stl_logging.h.in - -## 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 README.md README.windows \ - doc/designstyle.css doc/glog.html - -## The libraries (.so's) you want to install -lib_LTLIBRARIES = - -# The libraries libglog depends on. -COMMON_LIBS = $(PTHREAD_LIBS) $(GFLAGS_LIBS) $(UNWIND_LIBS) -# Compile switches for our unittest. -TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS) $(GFLAGS_CFLAGS) \ - $(MINGW_CFLAGS) $(AM_CXXFLAGS) -# Libraries for our unittest. -TEST_LIBS = $(GTEST_LIBS) $(GMOCK_LIBS) $(GFLAGS_LIBS) - -## 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 = -# Set a small stack size so that (at least on Linux) PIEs are mapped at a lower -# address than DSOs. This is used by symbolize_pie_unittest to check that we can -# successfully symbolize PIEs loaded at low addresses. -TESTS_ENVIRONMENT = ulimit -s 8192; -check_SCRIPTS = -# Every time you add a unittest to check_SCRIPTS, add it here too -noinst_SCRIPTS = -# Binaries used for script-based unittests. -TEST_BINARIES = - -TESTS += logging_unittest -logging_unittest_SOURCES = $(gloginclude_HEADERS) \ - src/logging_unittest.cc \ - src/config_for_unittests.h \ - src/mock-log.h -nodist_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS) -logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS) -logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) - -check_SCRIPTS += logging_striplog_test_sh -noinst_SCRIPTS += src/logging_striplog_test.sh -logging_striplog_test_sh: logging_striptest0 logging_striptest2 logging_striptest10 - $(top_srcdir)/src/logging_striplog_test.sh - -check_SCRIPTS += demangle_unittest_sh -noinst_SCRIPTS += src/demangle_unittest.sh -demangle_unittest_sh: demangle_unittest - $(builddir)/demangle_unittest # force to create lt-demangle_unittest - $(top_srcdir)/src/demangle_unittest.sh - -check_SCRIPTS += signalhandler_unittest_sh -noinst_SCRIPTS += src/signalhandler_unittest.sh -signalhandler_unittest_sh: signalhandler_unittest - $(builddir)/signalhandler_unittest # force to create lt-signalhandler_unittest - $(top_srcdir)/src/signalhandler_unittest.sh - -TEST_BINARIES += logging_striptest0 -logging_striptest0_SOURCES = $(gloginclude_HEADERS) \ - src/logging_striptest_main.cc -nodist_logging_striptest0_SOURCES = $(nodist_gloginclude_HEADERS) -logging_striptest0_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -logging_striptest0_LDFLAGS = $(PTHREAD_CFLAGS) -logging_striptest0_LDADD = libglog.la $(COMMON_LIBS) - -TEST_BINARIES += logging_striptest2 -logging_striptest2_SOURCES = $(gloginclude_HEADERS) \ - src/logging_striptest2.cc -nodist_logging_striptest2_SOURCES = $(nodist_gloginclude_HEADERS) -logging_striptest2_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -logging_striptest2_LDFLAGS = $(PTHREAD_CFLAGS) -logging_striptest2_LDADD = libglog.la $(COMMON_LIBS) - -TEST_BINARIES += logging_striptest10 -logging_striptest10_SOURCES = $(gloginclude_HEADERS) \ - src/logging_striptest10.cc -nodist_logging_striptest10_SOURCES = $(nodist_gloginclude_HEADERS) -logging_striptest10_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -logging_striptest10_LDFLAGS = $(PTHREAD_CFLAGS) -logging_striptest10_LDADD = libglog.la $(COMMON_LIBS) - -TESTS += demangle_unittest -demangle_unittest_SOURCES = $(gloginclude_HEADERS) \ - src/demangle_unittest.cc -nodist_demangle_unittest_SOURCES = $(nodist_gloginclude_HEADERS) -demangle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -demangle_unittest_LDFLAGS = $(PTHREAD_CFLAGS) -demangle_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) - -TESTS += stacktrace_unittest -stacktrace_unittest_SOURCES = $(gloginclude_HEADERS) \ - src/stacktrace_unittest.cc -nodist_stacktrace_unittest_SOURCES = $(nodist_gloginclude_HEADERS) -stacktrace_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -stacktrace_unittest_LDFLAGS = $(PTHREAD_CFLAGS) -stacktrace_unittest_LDADD = libglog.la $(COMMON_LIBS) - -TESTS += symbolize_unittest -symbolize_unittest_SOURCES = $(gloginclude_HEADERS) \ - src/symbolize_unittest.cc -nodist_symbolize_unittest_SOURCES = $(nodist_gloginclude_HEADERS) -symbolize_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -symbolize_unittest_LDFLAGS = $(PTHREAD_CFLAGS) -symbolize_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) - -TESTS += symbolize_pie_unittest -symbolize_pie_unittest_SOURCES = $(gloginclude_HEADERS) \ - src/symbolize_unittest.cc -nodist_symbolize_pie_unittest_SOURCES = $(nodist_gloginclude_HEADERS) -symbolize_pie_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -fPIE -symbolize_pie_unittest_LDFLAGS = $(PTHREAD_CFLAGS) -pie -symbolize_pie_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) - -TESTS += stl_logging_unittest -stl_logging_unittest_SOURCES = $(gloginclude_HEADERS) \ - src/stl_logging_unittest.cc -nodist_stl_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS) -stl_logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -stl_logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS) -stl_logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) - -TEST_BINARIES += signalhandler_unittest -signalhandler_unittest_SOURCES = $(gloginclude_HEADERS) \ - src/signalhandler_unittest.cc -nodist_signalhandler_unittest_SOURCES = $(nodist_gloginclude_HEADERS) -signalhandler_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -signalhandler_unittest_LDFLAGS = $(PTHREAD_CFLAGS) -signalhandler_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) - -TESTS += utilities_unittest -utilities_unittest_SOURCES = $(gloginclude_HEADERS) \ - src/utilities_unittest.cc -nodist_utilities_unittest_SOURCES = $(nodist_gloginclude_HEADERS) -utilities_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -utilities_unittest_LDFLAGS = $(PTHREAD_CFLAGS) -utilities_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) - -if HAVE_GMOCK -TESTS += mock_log_test -mock_log_test_SOURCES = $(gloginclude_HEADERS) \ - src/mock-log_test.cc -nodist_mock_log_test_SOURCES = $(nodist_gloginclude_HEADERS) -mock_log_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) -mock_log_test_LDFLAGS = $(PTHREAD_CFLAGS) -mock_log_test_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) -endif - -## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS - -lib_LTLIBRARIES += libglog.la -libglog_la_SOURCES = $(gloginclude_HEADERS) \ - src/logging.cc src/raw_logging.cc src/vlog_is_on.cc \ - src/utilities.cc src/utilities.h \ - src/demangle.cc src/demangle.h \ - src/stacktrace.h \ - src/stacktrace_generic-inl.h \ - src/stacktrace_libunwind-inl.h \ - src/stacktrace_powerpc-inl.h \ - src/stacktrace_x86-inl.h \ - src/stacktrace_x86_64-inl.h \ - src/symbolize.cc src/symbolize.h \ - src/signalhandler.cc \ - src/base/mutex.h src/base/googleinit.h \ - src/base/commandlineflags.h src/googletest.h -nodist_libglog_la_SOURCES = $(nodist_gloginclude_HEADERS) - -libglog_la_CXXFLAGS = $(PTHREAD_CFLAGS) $(GFLAGS_CFLAGS) $(MINGW_CFLAGS) \ - $(AM_CXXFLAGS) -DNDEBUG -libglog_la_LDFLAGS = $(PTHREAD_CFLAGS) $(GFLAGS_LDFLAGS) -libglog_la_LIBADD = $(COMMON_LIBS) - -## The location of the windows project file for each binary we make -WINDOWS_PROJECTS = google-glog.sln -WINDOWS_PROJECTS += vsprojects/libglog/libglog.vcproj -WINDOWS_PROJECTS += vsprojects/logging_unittest/logging_unittest.vcproj -WINDOWS_PROJECTS += vsprojects/libglog_static/libglog_static.vcproj -WINDOWS_PROJECTS += vsprojects/logging_unittest_static/logging_unittest_static.vcproj - -## ^^^^ 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) $(TEST_BINARIES) - -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} - -# Windows wants write permission to .vcproj files and maybe even sln files. -dist-hook: - test -e "$(distdir)/vsprojects" \ - && chmod -R u+w $(distdir)/*.sln $(distdir)/vsprojects/ - -libtool: $(LIBTOOL_DEPS) - $(SHELL) ./config.status --recheck - -EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec \ - packages/deb.sh packages/deb/* \ - $(SCRIPTS) src/logging_unittest.err src/demangle_unittest.txt \ - src/windows/config.h src/windows/port.h src/windows/port.cc \ - src/windows/preprocess.sh \ - src/windows/glog/log_severity.h src/windows/glog/logging.h \ - src/windows/glog/raw_logging.h src/windows/glog/stl_logging.h \ - src/windows/glog/vlog_is_on.h \ - $(WINDOWS_PROJECTS) - -CLEANFILES = core demangle.dm demangle.nm signalhandler.out* \ - signalhandler_unittest.*.log.INFO.* - -# Add pkgconfig file -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libglog.pc diff --git a/README.md b/README.md deleted file mode 100644 index 965766c7c..000000000 --- a/README.md +++ /dev/null @@ -1,10 +0,0 @@ -[![Build Status](https://img.shields.io/travis/google/glog/master.svg?label=Travis)](https://travis-ci.org/google/glog/builds) -[![Grunt status](https://img.shields.io/appveyor/ci/google-admin/glog/master.svg?label=Appveyor)](https://ci.appveyor.com/project/google-admin/glog/history) - -This repository contains a C++ implementation of the Google logging -module. Documentation for the implementation is in doc/. - -See INSTALL for (generic) installation instructions for C++: basically -```sh -./autogen.sh && ./configure && make && make install -``` diff --git a/README.rst b/README.rst new file mode 100644 index 000000000..fa4372238 --- /dev/null +++ b/README.rst @@ -0,0 +1,800 @@ +Google Logging Library +====================== + +|Build Status| |Grunt status| + +The Google Logging Library (glog) implements application-level logging. +The library provides logging APIs based on C++-style streams and various +helper macros. + +Getting Started +--------------- + +You can log a message by simply streaming things to ``LOG``\ (`__>), e.g., + +.. code:: cpp + + #include + + int main(int argc, char* argv[]) { + // Initialize Google’s logging library. + google::InitGoogleLogging(argv[0]); + + // ... + LOG(INFO) << "Found " << num_cookies << " cookies"; + } + + +For a detailed overview of glog features and their usage, please refer +to the `user guide <#user-guide>`__. + +.. contents:: Table of Contents + + +Building from Source +-------------------- + +glog supports multiple build systems for compiling the project from +source: `Bazel <#bazel>`__, `CMake <#cmake>`__, and `vcpkg <#vcpkg>`__. + +Bazel +~~~~~ + +To use glog within a project which uses the +`Bazel `__ build tool, add the following lines to +your ``WORKSPACE`` file: + +.. code:: starlark + + load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + + http_archive( + name = "com_github_gflags_gflags", + sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf", + strip_prefix = "gflags-2.2.2", + urls = ["https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"], + ) + + http_archive( + name = "com_github_google_glog", + sha256 = "62efeb57ff70db9ea2129a16d0f908941e355d09d6d83c9f7b18557c0a7ab59e", + strip_prefix = "glog-d516278b1cd33cd148e8989aec488b6049a4ca0b", + urls = ["https://github.com/google/glog/archive/d516278b1cd33cd148e8989aec488b6049a4ca0b.zip"], + ) + +You can then add ``@com_github_google_glog//:glog`` to the deps section of a +``cc_binary`` or ``cc_library`` rule, and ``#include `` to +include it in your source code. Here’s a simple example: + +:: code:: starlark + + cc_binary( + name = "main", + srcs = ["main.cc"], + deps = ["@com_github_google_glog//:glog"], + ) + +CMake +~~~~~ + +glog also supports CMake that can be used to build the project on a wide +range of platforms. If you don’t have CMake installed already, you can +download it for from CMake’s `official +website `__. + +CMake works by generating native makefiles or build projects that can be +used in the compiler environment of your choice. You can either build +glog with CMake as a standalone project or it can be incorporated into +an existing CMake build for another project. + +Building glog with CMake +^^^^^^^^^^^^^^^^^^^^^^^^ + +When building glog as a standalone project, on Unix-like systems with +GNU Make as build tool, the typical workflow is: + +1. Get the source code and change to it. e.g., cloning with git: + + .. code:: bash + + git clone git@github.com:google/glog.git + cd glog + +2. Run CMake to configure the build tree. + + .. code:: bash + + cmake -H. -Bbuild -G "Unix Makefiles" + + Note: to get the list of available generators (e.g., Visual Studio), use ``-G ""`` + +3. Afterwards, generated files can be used to compile the project. + + .. code:: bash + + cmake --build build + +4. Test the build software (optional). + + .. code:: bash + + cmake --build build --target test + +5. Install the built files (optional). + + .. code:: bash + + cmake --build build --target install + +Consuming glog in a CMake Project +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you have glog installed in your system, you can use the CMake command +``find_package`` to build against glog in your CMake Project as follows: + +.. code:: cmake + + cmake_minimum_required (VERSION 3.0.2) + project (myproj VERSION 1.0) + + find_package (glog 0.4.0 REQUIRED) + + add_executable (myapp main.cpp) + target_link_libraries (myapp glog::glog) + +Compile definitions and options will be added automatically to your +target as needed. + +Incorporating glog into a CMake Project +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can also use the CMake command ``add_subdirectory`` to include glog +directly from a subdirectory of your project by replacing the +``find_package`` call from the previous example by ``add_subdirectory``. +The ``glog::glog`` target is in this case an ``ALIAS`` library target +for the ``glog`` library target. + +Again, compile definitions and options will be added automatically to +your target as needed. + +vcpkg +~~~~~ + +The url of vcpkg is: https://github.com/Microsoft/vcpkg You can download +and install glog using the vcpkg dependency manager: + +.. code:: bash + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + ./vcpkg install glog + +The glog port in vcpkg is kept up to date by Microsoft team members and +community contributors. If the version is out of date, please create an +issue or pull request on the vcpkg repository. + +User Guide +---------- + +glog defines a series of macros that simplify many common logging tasks. +You can log messages by severity level, control logging behavior from +the command line, log based on conditionals, abort the program when +expected conditions are not met, introduce your own verbose logging +levels, and more. + +Following sections describe the functionality supported by glog. Please +note this description may not be complete but limited to the most useful +ones. If you want to find less common features, please check header +files under ``src/glog`` directory. + +Severity Levels +~~~~~~~~~~~~~~~ + +You can specify one of the following severity levels (in increasing +order of severity): ``INFO``, ``WARNING``, ``ERROR``, and ``FATAL``. +Logging a ``FATAL`` message terminates the program (after the message is +logged). Note that messages of a given severity are logged not only in +the logfile for that severity, but also in all logfiles of lower +severity. E.g., a message of severity ``FATAL`` will be logged to the +logfiles of severity ``FATAL``, ``ERROR``, ``WARNING``, and ``INFO``. + +The ``DFATAL`` severity logs a ``FATAL`` error in debug mode (i.e., +there is no ``NDEBUG`` macro defined), but avoids halting the program in +production by automatically reducing the severity to ``ERROR``. + +Unless otherwise specified, glog writes to the filename +``/tmp/\.\.\.log.\.\.\.\`` +(e.g., +``/tmp/hello_world.example.com.hamaji.log.INFO.20080709-222411.10474``). +By default, glog copies the log messages of severity level ``ERROR`` or +``FATAL`` to standard error (``stderr``) in addition to log files. + +Setting Flags +~~~~~~~~~~~~~ + +Several flags influence glog’s output behavior. If the `Google gflags +library `__ is installed on your +machine, the ``configure`` script (see the INSTALL file in the package +for detail of this script) will automatically detect and use it, +allowing you to pass flags on the command line. For example, if you want +to turn the flag ``--logtostderr`` on, you can start your application +with the following command line: + +.. code:: bash + + ./your_application --logtostderr=1 + +If the Google gflags library isn’t installed, you set flags via +environment variables, prefixing the flag name with ``GLOG_``, e.g., + +.. code:: bash + + GLOG_logtostderr=1 ./your_application + +The following flags are most commonly used: + +``logtostderr`` (``bool``, default=\ ``false``) + Log messages to ``stderr`` instead of logfiles. Note: you can set + binary flags to ``true`` by specifying ``1``, ``true``, or ``yes`` + (case insensitive). Also, you can set binary flags to ``false`` by + specifying ``0``, ``false``, or ``no`` (again, case insensitive). + +``stderrthreshold`` (``int``, default=2, which is ``ERROR``) + Copy log messages at or above this level to stderr in addition to + logfiles. The numbers of severity levels ``INFO``, ``WARNING``, + ``ERROR``, and ``FATAL`` are 0, 1, 2, and 3, respectively. + +``minloglevel`` (``int``, default=0, which is ``INFO``) + Log messages at or above this level. Again, the numbers of severity + levels ``INFO``, ``WARNING``, ``ERROR``, and ``FATAL`` are 0, 1, 2, + and 3, respectively. + +``log_dir`` (``string``, default="") + If specified, logfiles are written into this directory instead of the + default logging directory. + +``v`` (``int``, default=0) + Show all ``VLOG(m)`` messages for ``m`` less or equal the value of + this flag. Overridable by ``--vmodule``. See `the section about + verbose logging <#verbose>`__ for more detail. + +``vmodule`` (``string``, default="") + Per-module verbose level. The argument has to contain a + comma-separated list of =. is a + glob pattern (e.g., ``gfs*`` for all modules whose name starts with + "gfs"), matched against the filename base (that is, name ignoring + .cc/.h./-inl.h). overrides any value given by ``--v``. + See also `the section about verbose logging <#verbose>`__. + +There are some other flags defined in logging.cc. Please grep the source +code for ``DEFINE_`` to see a complete list of all flags. + +You can also modify flag values in your program by modifying global +variables ``FLAGS_*`` . Most settings start working immediately after +you update ``FLAGS_*`` . The exceptions are the flags related to +destination files. For example, you might want to set ``FLAGS_log_dir`` +before calling ``google::InitGoogleLogging`` . Here is an example: + +.. code:: cpp + + LOG(INFO) << "file"; + // Most flags work immediately after updating values. + FLAGS_logtostderr = 1; + LOG(INFO) << "stderr"; + FLAGS_logtostderr = 0; + // This won’t change the log destination. If you want to set this + // value, you should do this before google::InitGoogleLogging . + FLAGS_log_dir = "/some/log/directory"; + LOG(INFO) << "the same file"; + +Conditional / Occasional Logging +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sometimes, you may only want to log a message under certain conditions. +You can use the following macros to perform conditional logging: + +.. code:: cpp + + LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; + +The "Got lots of cookies" message is logged only when the variable +``num_cookies`` exceeds 10. If a line of code is executed many times, it +may be useful to only log a message at certain intervals. This kind of +logging is most useful for informational messages. + +.. code:: cpp + + LOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie"; + +The above line outputs a log messages on the 1st, 11th, 21st, ... times +it is executed. Note that the special ``google::COUNTER`` value is used +to identify which repetition is happening. + +You can combine conditional and occasional logging with the following +macro. + +.. code:: cpp + + LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << google::COUNTER + << "th big cookie"; + +Instead of outputting a message every nth time, you can also limit the +output to the first n occurrences: + +.. code:: cpp + + LOG_FIRST_N(INFO, 20) << "Got the " << google::COUNTER << "th cookie"; + +Outputs log messages for the first 20 times it is executed. Again, the +``google::COUNTER`` identifier indicates which repetition is happening. + +Debug Mode Support +~~~~~~~~~~~~~~~~~~ + +Special "debug mode" logging macros only have an effect in debug mode +and are compiled away to nothing for non-debug mode compiles. Use these +macros to avoid slowing down your production application due to +excessive logging. + +.. code:: cpp + + DLOG(INFO) << "Found cookies"; + DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; + DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie"; + + +``CHECK`` Macros +~~~~~~~~~~~~~~~~ + +It is a good practice to check expected conditions in your program +frequently to detect errors as early as possible. The ``CHECK`` macro +provides the ability to abort the application when a condition is not +met, similar to the ``assert`` macro defined in the standard C library. + +``CHECK`` aborts the application if a condition is not true. Unlike +``assert``, it is \*not\* controlled by ``NDEBUG``, so the check will be +executed regardless of compilation mode. Therefore, ``fp->Write(x)`` in +the following example is always executed: + +.. code:: cpp + + CHECK(fp->Write(x) == 4) << "Write failed!"; + +There are various helper macros for equality/inequality checks - +``CHECK_EQ``, ``CHECK_NE``, ``CHECK_LE``, ``CHECK_LT``, ``CHECK_GE``, +and ``CHECK_GT``. They compare two values, and log a ``FATAL`` message +including the two values when the result is not as expected. The values +must have ``operator<<(ostream, ...)`` defined. + +You may append to the error message like so: + +.. code:: cpp + + CHECK_NE(1, 2) << ": The world must be ending!"; + +We are very careful to ensure that each argument is evaluated exactly +once, and that anything which is legal to pass as a function argument is +legal here. In particular, the arguments may be temporary expressions +which will end up being destroyed at the end of the apparent statement, +for example: + +.. code:: cpp + + CHECK_EQ(string("abc")[1], ’b’); + +The compiler reports an error if one of the arguments is a pointer and +the other is ``NULL``. To work around this, simply ``static_cast`` +``NULL`` to the type of the desired pointer. + +.. code:: cpp + + CHECK_EQ(some_ptr, static_cast(NULL)); + +Better yet, use the ``CHECK_NOTNULL`` macro: + +.. code:: cpp + + CHECK_NOTNULL(some_ptr); + some_ptr->DoSomething(); + +Since this macro returns the given pointer, this is very useful in +constructor initializer lists. + +.. code:: cpp + + struct S { + S(Something* ptr) : ptr_(CHECK_NOTNULL(ptr)) {} + Something* ptr_; + }; + +Note that you cannot use this macro as a C++ stream due to this feature. +Please use ``CHECK_EQ`` described above to log a custom message before +aborting the application. + +If you are comparing C strings (``char *``), a handy set of macros +performs case sensitive as well as case insensitive comparisons - +``CHECK_STREQ``, ``CHECK_STRNE``, ``CHECK_STRCASEEQ``, and +``CHECK_STRCASENE``. The CASE versions are case-insensitive. You can +safely pass ``NULL`` pointers for this macro. They treat ``NULL`` and +any non-``NULL`` string as not equal. Two ``NULL``\ s are equal. + +Note that both arguments may be temporary strings which are destructed +at the end of the current "full expression" (e.g., +``CHECK_STREQ(Foo().c_str(), Bar().c_str())`` where ``Foo`` and ``Bar`` +return C++’s ``std::string``). + +The ``CHECK_DOUBLE_EQ`` macro checks the equality of two floating point +values, accepting a small error margin. ``CHECK_NEAR`` accepts a third +floating point argument, which specifies the acceptable error margin. + +Verbose Logging +~~~~~~~~~~~~~~~ + +When you are chasing difficult bugs, thorough log messages are very +useful. However, you may want to ignore too verbose messages in usual +development. For such verbose logging, glog provides the ``VLOG`` macro, +which allows you to define your own numeric logging levels. The ``--v`` +command line option controls which verbose messages are logged: + +.. code:: cpp + + VLOG(1) << "I’m printed when you run the program with --v=1 or higher"; + VLOG(2) << "I’m printed when you run the program with --v=2 or higher"; + +With ``VLOG``, the lower the verbose level, the more likely messages are +to be logged. For example, if ``--v==1``, ``VLOG(1)`` will log, but +``VLOG(2)`` will not log. This is opposite of the severity level, where +``INFO`` is 0, and ``ERROR`` is 2. ``--minloglevel`` of 1 will log +``WARNING`` and above. Though you can specify any integers for both +``VLOG`` macro and ``--v`` flag, the common values for them are small +positive integers. For example, if you write ``VLOG(0)``, you should +specify ``--v=-1`` or lower to silence it. This is less useful since we +may not want verbose logs by default in most cases. The ``VLOG`` macros +always log at the ``INFO`` log level (when they log at all). + +Verbose logging can be controlled from the command line on a per-module +basis: + +.. code:: bash + + --vmodule=mapreduce=2,file=1,gfs*=3 --v=0 + +will: + +(a) Print ``VLOG(2)`` and lower messages from mapreduce.{h,cc} +(b) Print ``VLOG(1)`` and lower messages from file.{h,cc} +(c) Print ``VLOG(3)`` and lower messages from files prefixed with "gfs" +(d) Print ``VLOG(0)`` and lower messages from elsewhere + +The wildcarding functionality shown by (c) supports both ’*’ (matches 0 +or more characters) and ’?’ (matches any single character) wildcards. +Please also check the section about `command line flags <#flags>`__. + +There’s also ``VLOG_IS_ON(n)`` "verbose level" condition macro. This +macro returns true when the ``--v`` is equal or greater than ``n``. To +be used as + +.. code:: cpp + + if (VLOG_IS_ON(2)) { + // do some logging preparation and logging + // that can’t be accomplished with just VLOG(2) << ...; + } + +Verbose level condition macros ``VLOG_IF``, ``VLOG_EVERY_N`` and +``VLOG_IF_EVERY_N`` behave analogous to ``LOG_IF``, ``LOG_EVERY_N``, +``LOF_IF_EVERY``, but accept a numeric verbosity level as opposed to a +severity level. + +.. code:: cpp + + VLOG_IF(1, (size > 1024)) + << "I’m printed when size is more than 1024 and when you run the " + "program with --v=1 or more"; + VLOG_EVERY_N(1, 10) + << "I’m printed every 10th occurrence, and when you run the program " + "with --v=1 or more. Present occurence is " << google::COUNTER; + VLOG_IF_EVERY_N(1, (size > 1024), 10) + << "I’m printed on every 10th occurence of case when size is more " + " than 1024, when you run the program with --v=1 or more. "; + "Present occurence is " << google::COUNTER; + +Failure Signal Handler +~~~~~~~~~~~~~~~~~~~~~~ + +The library provides a convenient signal handler that will dump useful +information when the program crashes on certain signals such as +``SIGSEGV``. The signal handler can be installed by +``google::InstallFailureSignalHandler()``. The following is an example +of output from the signal handler. + +:: + + *** Aborted at 1225095260 (unix time) try "date -d @1225095260" if you are using GNU date *** + *** SIGSEGV (@0x0) received by PID 17711 (TID 0x7f893090a6f0) from PID 0; stack trace: *** + PC: @ 0x412eb1 TestWaitingLogSink::send() + @ 0x7f892fb417d0 (unknown) + @ 0x412eb1 TestWaitingLogSink::send() + @ 0x7f89304f7f06 google::LogMessage::SendToLog() + @ 0x7f89304f35af google::LogMessage::Flush() + @ 0x7f89304f3739 google::LogMessage::~LogMessage() + @ 0x408cf4 TestLogSinkWaitTillSent() + @ 0x4115de main + @ 0x7f892f7ef1c4 (unknown) + @ 0x4046f9 (unknown) + +By default, the signal handler writes the failure dump to the standard +error. You can customize the destination by ``InstallFailureWriter()``. + +Performance of Messages +~~~~~~~~~~~~~~~~~~~~~~~ + +The conditional logging macros provided by glog (e.g., ``CHECK``, +``LOG_IF``, ``VLOG``, ...) are carefully implemented and don’t execute +the right hand side expressions when the conditions are false. So, the +following check may not sacrifice the performance of your application. + +.. code:: cpp + + CHECK(obj.ok) << obj.CreatePrettyFormattedStringButVerySlow(); + +User-defined Failure Function +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``FATAL`` severity level messages or unsatisfied ``CHECK`` condition +terminate your program. You can change the behavior of the termination +by ``InstallFailureFunction``. + +.. code:: cpp + + void YourFailureFunction() { + // Reports something... + exit(1); + } + + int main(int argc, char* argv[]) { + google::InstallFailureFunction(&YourFailureFunction); + } + +By default, glog tries to dump stacktrace and makes the program exit +with status 1. The stacktrace is produced only when you run the program +on an architecture for which glog supports stack tracing (as of +September 2008, glog supports stack tracing for x86 and x86_64). + +Raw Logging +~~~~~~~~~~~ + +The header file ```` can be used for thread-safe +logging, which does not allocate any memory or acquire any locks. +Therefore, the macros defined in this header file can be used by +low-level memory allocation and synchronization code. Please check +``src/glog/raw_logging.h.in`` for detail. + +Google Style ``perror()`` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +``PLOG()`` and ``PLOG_IF()`` and ``PCHECK()`` behave exactly like their +``LOG*`` and ``CHECK`` equivalents with the addition that they append a +description of the current state of errno to their output lines. E.g. + +.. code:: cpp + + PCHECK(write(1, NULL, 2) >= 0) << "Write NULL failed"; + +This check fails with the following error message. + +:: + + F0825 185142 test.cc:22] Check failed: write(1, NULL, 2) >= 0 Write NULL failed: Bad address [14] + +Syslog +~~~~~~ + +``SYSLOG``, ``SYSLOG_IF``, and ``SYSLOG_EVERY_N`` macros are available. +These log to syslog in addition to the normal logs. Be aware that +logging to syslog can drastically impact performance, especially if +syslog is configured for remote logging! Make sure you understand the +implications of outputting to syslog before you use these macros. In +general, it’s wise to use these macros sparingly. + +Strip Logging Messages +~~~~~~~~~~~~~~~~~~~~~~ + +Strings used in log messages can increase the size of your binary and +present a privacy concern. You can therefore instruct glog to remove all +strings which fall below a certain severity level by using the +``GOOGLE_STRIP_LOG`` macro: + +If your application has code like this: + +.. code:: cpp + + #define GOOGLE_STRIP_LOG 1 // this must go before the #include! + #include + +The compiler will remove the log messages whose severities are less than +the specified integer value. Since ``VLOG`` logs at the severity level +``INFO`` (numeric value ``0``), setting ``GOOGLE_STRIP_LOG`` to 1 or +greater removes all log messages associated with ``VLOG``\ s as well as +``INFO`` log statements. + +Automatically Remove Old Logs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To enable the log cleaner: + +.. code:: cpp + + google::EnableLogCleaner(3); // keep your logs for 3 days + +And then glog will check if there are overdue logs whenever a flush is +performed. In this example, any log file from your project whose last +modified time is greater than 3 days will be unlink()ed. + +This feature can be disabled at any time (if it has been enabled) + +.. code:: cpp + + google::DisableLogCleaner(); + +Notes for Windows Users +~~~~~~~~~~~~~~~~~~~~~~~ + +glog defines a severity level ``ERROR``, which is also defined in +``windows.h`` . You can make glog not define ``INFO``, ``WARNING``, +``ERROR``, and ``FATAL`` by defining ``GLOG_NO_ABBREVIATED_SEVERITIES`` +before including ``glog/logging.h`` . Even with this macro, you can +still use the iostream like logging facilities: + +.. code:: cpp + + #define GLOG_NO_ABBREVIATED_SEVERITIES + #include + #include + + // ... + + LOG(ERROR) << "This should work"; + LOG_IF(ERROR, x > y) << "This should be also OK"; + +However, you cannot use ``INFO``, ``WARNING``, ``ERROR``, and ``FATAL`` +anymore for functions defined in ``glog/logging.h`` . + +.. code:: cpp + + #define GLOG_NO_ABBREVIATED_SEVERITIES + #include + #include + + // ... + + // This won’t work. + // google::FlushLogFiles(google::ERROR); + + // Use this instead. + google::FlushLogFiles(google::GLOG_ERROR); + +If you don’t need ``ERROR`` defined by ``windows.h``, there are a couple +of more workarounds which sometimes don’t work: + +- ``#define WIN32_LEAN_AND_MEAN`` or ``NOGDI`` **before** you + ``#include windows.h``. +- ``#undef ERROR`` **after** you ``#include windows.h`` . + +See `this +issue `__ for +more detail. + + +Installation Notes for 64-bit Linux Systems +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The glibc built-in stack-unwinder on 64-bit systems has some problems +with glog. (In particular, if you are using +InstallFailureSignalHandler(), the signal may be raised in the middle of +malloc, holding some malloc-related locks when they invoke the stack +unwinder. The built-in stack unwinder may call malloc recursively, which +may require the thread to acquire a lock it already holds: deadlock.) + +For that reason, if you use a 64-bit system and you need +``InstallFailureSignalHandler()``, we strongly recommend you install +``libunwind`` before trying to configure or install google glog. +libunwind can be found +`here `__. + +Even if you already have ``libunwind`` installed, you will probably +still need to install from the snapshot to get the latest version. + +Caution: if you install libunwind from the URL above, be aware that you +may have trouble if you try to statically link your binary with glog: +that is, if you link with ``gcc -static -lgcc_eh ...``. This is because +both ``libunwind`` and ``libgcc`` implement the same C++ exception +handling APIs, but they implement them differently on some platforms. +This is not likely to be a problem on ia64, but may be on x86-64. + +Also, if you link binaries statically, make sure that you add +``-Wl,--eh-frame-hdr`` to your linker options. This is required so that +``libunwind`` can find the information generated by the compiler +required for stack unwinding. + +Using ``-static`` is rare, though, so unless you know this will affect +you it probably won’t. + +If you cannot or do not wish to install libunwind, you can still try to +use two kinds of stack-unwinder: 1. glibc built-in stack-unwinder and 2. +frame pointer based stack-unwinder. + +1. As we already mentioned, glibc’s unwinder has a deadlock issue. + However, if you don’t use ``InstallFailureSignalHandler()`` or you + don’t worry about the rare possibilities of deadlocks, you can use + this stack-unwinder. If you specify no options and ``libunwind`` + isn’t detected on your system, the configure script chooses this + unwinder by default. + +2. The frame pointer based stack unwinder requires that your + application, the glog library, and system libraries like libc, all be + compiled with a frame pointer. This is *not* the default for x86-64. + + +How to Contribute +----------------- + +We’d love to accept your patches and contributions to this project. +There are a just a few small guidelines you need to follow. + +Contributor License Agreement (CLA) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Contributions to any Google project must be accompanied by a Contributor +License Agreement. This is not a copyright **assignment**, it simply +gives Google permission to use and redistribute your contributions as +part of the project. + +* If you are an individual writing original source code and you’re sure + you own the intellectual property, then you’ll need to sign an + `individual + CLA `__. +* If you work for a company that wants to allow you to contribute your + work, then you’ll need to sign a `corporate + CLA `__. + +You generally only need to submit a CLA once, so if you’ve already +submitted one (even if it was for a different project), you probably +don’t need to do it again. + +Once your CLA is submitted (or if you already submitted one for another +Google project), make a commit adding yourself to the +`AUTHORS <./AUTHORS>`__ and `CONTRIBUTORS `__ files. This +commit can be part of your first `pull +request `__. + +Submitting a Patch +~~~~~~~~~~~~~~~~~~ + +1. It’s generally best to start by opening a new issue describing the + bug or feature you’re intending to fix. Even if you think it’s + relatively minor, it’s helpful to know what people are working on. + Mention in the initial issue that you are planning to work on that + bug or feature so that it can be assigned to you. +2. Follow the normal process of + `forking `__ the + project, and setup a new branch to work in. It’s important that each + group of changes be done in separate branches in order to ensure that + a pull request only includes the commits related to that bug or + feature. +3. Do your best to have `well-formed commit + messages `__ + for each change. This provides consistency throughout the project, + and ensures that commit messages are able to be formatted properly by + various git tools. +4. Finally, push the commits to your fork and submit a `pull + request `__. + + +.. |Build Status| image:: https://img.shields.io/travis/google/glog/master.svg?label=Travis + :target: https://travis-ci.org/google/glog/builds +.. |Grunt status| image:: https://img.shields.io/appveyor/ci/google-admin/glog/master.svg?label=Appveyor + :target: https://ci.appveyor.com/project/google-admin/glog/history diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 08b659040..000000000 --- a/autogen.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -eu - -autoreconf -i diff --git a/cmake/INSTALL.md b/cmake/INSTALL.md deleted file mode 100644 index 1377d652e..000000000 --- a/cmake/INSTALL.md +++ /dev/null @@ -1,81 +0,0 @@ -# Glog - CMake Support - -Glog comes with a CMake build script ([CMakeLists.txt](../CMakeLists.txt)) that can be used on a wide range of platforms. -If you don't have CMake installed already, you can download it for free from . - -CMake works by generating native makefiles or build projects that can be used in the compiler environment of your choice. -You can either build Glog with CMake as a standalone project or it can be incorporated into an existing CMake build for another project. - -## Table of Contents - -- [Building Glog with CMake](#building-glog-with-cmake) -- [Consuming Glog in a CMake Project](#consuming-glog-in-a-cmake-project) -- [Incorporating Glog into a CMake Project](#incorporating-glog-into-a-cmake-project) - -## Building Glog with CMake - -When building Glog as a standalone project, on Unix-like systems with GNU Make as build tool, the typical workflow is: - -1. Get the source code and change to it. -e.g. cloning with git: -```bash -git clone git@github.com:google/glog.git -cd glog -``` - -2. Run CMake to configure the build tree. -```bash -cmake -H. -Bbuild -G "Unix Makefiles" -``` -note: To get the list of available generators (e.g. Visual Studio), use `-G ""` - -3. Afterwards, generated files can be used to compile the project. -```bash -cmake --build build -``` - -4. Test the build software (optional). -```bash -cmake --build build --target test -``` - -5. Install the built files (optional). -```bash -cmake --build build --target install -``` - -## Consuming Glog in a CMake Project - -If you have Glog installed in your system, you can use the CMake command -`find_package()` to include it in your CMake Project. - -```cmake -cmake_minimum_required(VERSION 3.0.2) -project(myproj VERSION 1.0) - -find_package(glog 0.4.0 REQUIRED) - -add_executable(myapp main.cpp) -target_link_libraries(myapp glog::glog) -``` - -Compile definitions and options will be added automatically to your target as -needed. - -## Incorporating Glog into a CMake Project - -You can also use the CMake command `add_subdirectory()` to include Glog directly from a subdirectory of your project. -The **glog::glog** target is in this case an ALIAS library target for the **glog** library target. - -```cmake -cmake_minimum_required(VERSION 3.0.2) -project(myproj VERSION 1.0) - -add_subdirectory(glog) - -add_executable(myapp main.cpp) -target_link_libraries(myapp glog::glog) -``` - -Again, compile definitions and options will be added automatically to your target as -needed. diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 80005c267..000000000 --- a/configure.ac +++ /dev/null @@ -1,246 +0,0 @@ -## Process this file with autoconf to produce configure. -## In general, the safest way to proceed is to run the following: -## % aclocal -I . -I `pwd`/../autoconf && autoheader && autoconf && automake - -# make sure we're interpreted by some minimal autoconf -AC_PREREQ(2.57) - -AC_INIT(glog, 0.4.0, opensource@google.com) -# The argument here is just something that should be in the current directory -# (for sanity checking) -AC_CONFIG_SRCDIR(README.md) -AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE -AM_CONFIG_HEADER(src/config.h) - -AC_LANG(C++) - -# Checks for programs. -AC_PROG_CC -AC_PROG_CPP -AC_PROG_CXX -AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc - -AC_PROG_LIBTOOL -AC_SUBST(LIBTOOL_DEPS) - -# 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_HEADER(pwd.h, ac_cv_have_pwd_h=1, ac_cv_have_pwd_h=0) -AC_CHECK_HEADERS(unistd.h, ac_cv_have_unistd_h=1, ac_cv_have_unistd_h=0) -AC_CHECK_HEADERS(syscall.h) -AC_CHECK_HEADERS(sys/syscall.h) -# For backtrace with glibc. -AC_CHECK_HEADERS(execinfo.h) -# For backtrace with libunwind. -AC_CHECK_HEADERS(libunwind.h, ac_cv_have_libunwind_h=1, ac_cv_have_libunwind_h=0) -AC_CHECK_HEADERS(ucontext.h) -AC_CHECK_HEADERS(sys/utsname.h) -AC_CHECK_HEADERS(pwd.h) -AC_CHECK_HEADERS(syslog.h) -AC_CHECK_HEADERS(sys/time.h) -AC_CHECK_HEADERS(glob.h) -# For backtrace with gcc. -AC_CHECK_HEADERS(unwind.h) - -AC_CHECK_HEADER(windows.h, ac_cv_have_windows_h=1, ac_cv_have_windows_h=0) -if test x"$ac_cv_have_windows_h" = x"1"; then - MINGW_CFLAGS=-Isrc/windows -fi - -AC_CHECK_SIZEOF(void *) - -# 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(__uint16, ac_cv_have___uint16=1, ac_cv_have___uint16=0) - -AC_CHECK_FUNC(sigaltstack, - AC_DEFINE(HAVE_SIGALTSTACK, 1, - [Define if you have the `sigaltstack' function])) -AC_CHECK_FUNC(sigaction, - AC_DEFINE(HAVE_SIGACTION, 1, - [Define if you have the 'sigaction' function])) -AC_CHECK_FUNC(dladdr, - AC_DEFINE(HAVE_DLADDR, 1, - [Define if you have the `dladdr' function])) -AC_CHECK_FUNC(fcntl, - AC_DEFINE(HAVE_FCNTL, 1, - [Define if you have the `fcntl' function])) -AC_CHECK_FUNC(pread, - AC_DEFINE(HAVE_PREAD, 1, - [Define if you have the 'pread' function])) -AC_CHECK_FUNC(pwrite, - AC_DEFINE(HAVE_PWRITE, 1, - [Define if you have the 'pwrite' function])) - -AX_C___ATTRIBUTE__ -# We only care about these two attributes. -if test x"$ac_cv___attribute__" = x"yes"; then - ac_cv___attribute___noreturn="__attribute__ ((noreturn))" - ac_cv___attribute___noinline="__attribute__ ((noinline))" - ac_cv___attribute___printf_4_5="__attribute__((__format__ (__printf__, 4, 5)))" -else - ac_cv___attribute___noreturn= - ac_cv___attribute___noinline= - ac_cv___attribute___printf_4_5= -fi - -AX_C___BUILTIN_EXPECT -if test x"$ac_cv___builtin_expect" = x"yes"; then - ac_cv_have___builtin_expect=1 -else - ac_cv_have___builtin_expect=0 -fi - -AX_C___SYNC_VAL_COMPARE_AND_SWAP - -# On x86_64, instead of libunwind, we can choose to compile with frame-pointers -# (This isn't needed on i386, where -fno-omit-frame-pointer is the default). -AC_ARG_ENABLE(frame_pointers, - AS_HELP_STRING([--enable-frame-pointers], - [On x86_64 systems, compile with -fno-omit-frame-pointer (see INSTALL)]),, - enable_frame_pointers=no) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __x86_64__ == 1 ? 0 : 1])], - [is_x86_64=yes], [is_x86_64=no]) -AM_CONDITIONAL(ENABLE_FRAME_POINTERS, test "$enable_frame_pointers" = yes) -AM_CONDITIONAL(X86_64, test "$is_x86_64" = yes) - -AC_ARG_ENABLE(rtti, - AS_HELP_STRING([--disable-rtti], - [Disable RTTI in glog])) -AM_CONDITIONAL(DISABLE_RTTI, test x"$enable_rtti" = x"no") -if test x"$enable_rtti" = x"no"; then - AC_DEFINE(DISABLE_RTTI, 1, [define if glog doesn't use RTTI]) -fi - -# Some of the code in this directory depends on pthreads -ACX_PTHREAD -if test x"$acx_pthread_ok" = x"yes"; then - # To make libglog depend on libpthread on Linux, we need to add - # -lpthread in addition to -pthread. - AC_CHECK_LIB(pthread, pthread_self) -fi - -# Check if there is google-gflags library installed. -SAVE_CFLAGS="$CFLAGS" -SAVE_LIBS="$LIBS" -AC_ARG_WITH(gflags, AS_HELP_STRING[--with-gflags=GFLAGS_DIR], - GFLAGS_CFLAGS="-I${with_gflags}/include" - GFLAGS_LIBS="-L${with_gflags}/lib -lgflags" - CFLAGS="$CFLAGS $GFLAGS_CFLAGS" - LIBS="$LIBS $GFLAGS_LIBS" -) -AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0) -if test x"$ac_cv_have_libgflags" = x"1"; then - AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflags library]) - if test x"$GFLAGS_LIBS" = x""; then - GFLAGS_LIBS="-lgflags" - fi -else - GFLAGS_CFLAGS= - GFLAGS_LIBS= -fi -CFLAGS="$SAVE_CFLAGS" -LIBS="$SAVE_LIBS" - -# TODO(hamaji): Use official m4 macros provided by testing libraries -# once the m4 macro of Google Mocking becomes ready. -# Check if there is Google Test library installed. -AC_CHECK_PROG(GTEST_CONFIG, gtest-config, "yes") -AC_CHECK_LIB(gtest, main, have_gtest_lib="yes") -if test x"$GTEST_CONFIG" = "xyes" -a x"$have_gtest_lib" = "xyes"; then - GTEST_CFLAGS=`gtest-config --cppflags --cxxflags` - GTEST_LIBS=`gtest-config --ldflags --libs` - AC_DEFINE(HAVE_LIB_GTEST, 1, [define if you have google gtest library]) - - # Check if there is Google Mocking library installed. - AC_CHECK_PROG(GMOCK_CONFIG, gmock-config, "yes") - if test x"$GMOCK_CONFIG" = "xyes"; then - GMOCK_CFLAGS=`gmock-config --cppflags --cxxflags` - GMOCK_LIBS=`gmock-config --ldflags --libs` - AC_DEFINE(HAVE_LIB_GMOCK, 1, [define if you have google gmock library]) - else - # We don't run test cases which use Google Mocking framework. - GMOCK_CFLAGS= - GMOCK_LIBS= - fi -else - # We'll use src/googletest.h for our unittests. - GTEST_CFLAGS= - GTEST_LIBS= -fi -AM_CONDITIONAL(HAVE_GMOCK, test x"$GMOCK_CONFIG" = "xyes") - -# We want to link in libunwind if it exists -UNWIND_LIBS= -# Unfortunately, we need to check the header file in addition to the -# lib file to check if libunwind is available since libunwind-0.98 -# doesn't install all necessary header files. -if test x"$ac_cv_have_libunwind_h" = x"1"; then - AC_CHECK_LIB(unwind, backtrace, UNWIND_LIBS=-lunwind) -fi -AC_SUBST(UNWIND_LIBS) -if test x"$UNWIND_LIBS" != x""; then - AC_DEFINE(HAVE_LIB_UNWIND, 1, [define if you have libunwind]) -fi - -# We'd like to use read/write locks in several places in the code. -# See if our pthreads support extends to that. Note: for linux, it -# does as long as you define _XOPEN_SOURCE appropriately. -AC_RWLOCK - -# 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 -AC_DEFINE_GOOGLE_NAMESPACE(google) - -AC_CXX_USING_OPERATOR - -AC_PC_FROM_UCONTEXT(AC_MSG_WARN(Could not find the PC. Will not output failed addresses...)) - -AC_DEFINE_UNQUOTED(TEST_SRC_DIR, "$srcdir", [location of source code]) - -AC_ARG_ENABLE(unsymbolized-traces, - AS_HELP_STRING([--enable-unsymbolized-traces], - [Print file offsets in traces instead of symbolizing.]), - enable_unsymbolized_traces=yes) -if test x"$enable_unsymbolized_traces" = x"yes"; then - AC_DEFINE(PRINT_UNSYMBOLIZED_STACK_TRACES, 1, - [define if we should print file offsets in traces instead of symbolizing.]) -fi - -# These are what's needed by logging.h.in and raw_logging.h.in -AC_SUBST(ac_google_start_namespace) -AC_SUBST(ac_google_end_namespace) -AC_SUBST(ac_google_namespace) -AC_SUBST(ac_cv_cxx_using_operator) -AC_SUBST(ac_cv___attribute___noreturn) -AC_SUBST(ac_cv___attribute___noinline) -AC_SUBST(ac_cv___attribute___printf_4_5) -AC_SUBST(ac_cv_have___builtin_expect) -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_unistd_h) -AC_SUBST(ac_cv_have_uint16_t) -AC_SUBST(ac_cv_have_u_int16_t) -AC_SUBST(ac_cv_have___uint16) -AC_SUBST(ac_cv_have_libgflags) -AC_SUBST(GFLAGS_CFLAGS) -AC_SUBST(GTEST_CFLAGS) -AC_SUBST(GMOCK_CFLAGS) -AC_SUBST(MINGW_CFLAGS) -AC_SUBST(GFLAGS_LIBS) -AC_SUBST(GTEST_LIBS) -AC_SUBST(GMOCK_LIBS) - -# Write generated configuration file -AC_CONFIG_FILES([Makefile src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h]) -AC_OUTPUT(libglog.pc) diff --git a/doc/designstyle.css b/doc/designstyle.css deleted file mode 100644 index f5d1ec2f7..000000000 --- a/doc/designstyle.css +++ /dev/null @@ -1,115 +0,0 @@ -body { - background-color: #ffffff; - color: black; - margin-right: 1in; - margin-left: 1in; -} - - -h1, h2, h3, h4, h5, h6 { - color: #3366ff; - font-family: sans-serif; -} -@media print { - /* Darker version for printing */ - h1, h2, h3, h4, h5, h6 { - color: #000080; - font-family: helvetica, sans-serif; - } -} - -h1 { - text-align: center; - font-size: 18pt; -} -h2 { - margin-left: -0.5in; -} -h3 { - margin-left: -0.25in; -} -h4 { - margin-left: -0.125in; -} -hr { - margin-left: -1in; -} - -/* Definition lists: definition term bold */ -dt { - font-weight: bold; -} - -address { - text-align: right; -} -/* Use the tag for bits of code and for variables and objects. */ -code,pre,samp,var { - color: #006000; -} -/* Use the tag for file and directory paths and names. */ -file { - color: #905050; - font-family: monospace; -} -/* Use the tag for stuff the user should type. */ -kbd { - color: #600000; -} -div.note p { - float: right; - width: 3in; - margin-right: 0%; - padding: 1px; - border: 2px solid #6060a0; - background-color: #fffff0; -} - -UL.nobullets { - list-style-type: none; - list-style-image: none; - margin-left: -1em; -} - -/* -body:after { - content: "Google Confidential"; -} -*/ - -/* pretty printing styles. See prettify.js */ -.str { color: #080; } -.kwd { color: #008; } -.com { color: #800; } -.typ { color: #606; } -.lit { color: #066; } -.pun { color: #660; } -.pln { color: #000; } -.tag { color: #008; } -.atn { color: #606; } -.atv { color: #080; } -pre.prettyprint { padding: 2px; border: 1px solid #888; } - -.embsrc { background: #eee; } - -@media print { - .str { color: #060; } - .kwd { color: #006; font-weight: bold; } - .com { color: #600; font-style: italic; } - .typ { color: #404; font-weight: bold; } - .lit { color: #044; } - .pun { color: #440; } - .pln { color: #000; } - .tag { color: #006; font-weight: bold; } - .atn { color: #404; } - .atv { color: #060; } -} - -/* Table Column Headers */ -.hdr { - color: #006; - font-weight: bold; - background-color: #dddddd; } -.hdr2 { - color: #006; - background-color: #eeeeee; } \ No newline at end of file diff --git a/doc/glog.html b/doc/glog.html deleted file mode 100644 index 699d2ceb8..000000000 --- a/doc/glog.html +++ /dev/null @@ -1,631 +0,0 @@ - - - - -How To Use Google Logging Library (glog) - - - - - - - - - -

How To Use Google Logging Library (glog)

-(as of -) - -
- -
- -

Google glog is a library that implements application-level -logging. This library provides logging APIs based on C++-style -streams and various helper macros. -You can log a message by simply streaming things to LOG(<a -particular severity level>), e.g. - -

-   #include <glog/logging.h>
-
-   int main(int argc, char* argv[]) {
-     // Initialize Google's logging library.
-     google::InitGoogleLogging(argv[0]);
-
-     // ...
-     LOG(INFO) << "Found " << num_cookies << " cookies";
-   }
-
- -

Google glog defines a series of macros that simplify many common logging -tasks. You can log messages by severity level, control logging -behavior from the command line, log based on conditionals, abort the -program when expected conditions are not met, introduce your own -verbose logging levels, and more. This document describes the -functionality supported by glog. Please note that this document -doesn't describe all features in this library, but the most useful -ones. If you want to find less common features, please check -header files under src/glog directory. - -

Severity Level

- -

-You can specify one of the following severity levels (in -increasing order of severity): INFO, WARNING, -ERROR, and FATAL. -Logging a FATAL message terminates the program (after the -message is logged). -Note that messages of a given severity are logged not only in the -logfile for that severity, but also in all logfiles of lower severity. -E.g., a message of severity FATAL will be logged to the -logfiles of severity FATAL, ERROR, -WARNING, and INFO. - -

-The DFATAL severity logs a FATAL error in -debug mode (i.e., there is no NDEBUG macro defined), but -avoids halting the program in production by automatically reducing the -severity to ERROR. - -

Unless otherwise specified, glog writes to the filename -"/tmp/<program name>.<hostname>.<user name>.log.<severity level>.<date>.<time>.<pid>" -(e.g., "/tmp/hello_world.example.com.hamaji.log.INFO.20080709-222411.10474"). -By default, glog copies the log messages of severity level -ERROR or FATAL to standard error (stderr) -in addition to log files. - -

Setting Flags

- -

Several flags influence glog's output behavior. -If the Google -gflags library is installed on your machine, the -configure script (see the INSTALL file in the package for -detail of this script) will automatically detect and use it, -allowing you to pass flags on the command line. For example, if you -want to turn the flag --logtostderr on, you can start -your application with the following command line: - -

-   ./your_application --logtostderr=1
-
- -If the Google gflags library isn't installed, you set flags via -environment variables, prefixing the flag name with "GLOG_", e.g. - -
-   GLOG_logtostderr=1 ./your_application
-
- - - -

The following flags are most commonly used: - -

-
logtostderr (bool, default=false) -
Log messages to stderr instead of logfiles.
-Note: you can set binary flags to true by specifying -1, true, or yes (case -insensitive). -Also, you can set binary flags to false by specifying -0, false, or no (again, case -insensitive). -
stderrthreshold (int, default=2, which -is ERROR) -
Copy log messages at or above this level to stderr in -addition to logfiles. The numbers of severity levels -INFO, WARNING, ERROR, and -FATAL are 0, 1, 2, and 3, respectively. -
minloglevel (int, default=0, which -is INFO) -
Log messages at or above this level. Again, the numbers of -severity levels INFO, WARNING, -ERROR, and FATAL are 0, 1, 2, and 3, -respectively. -
log_dir (string, default="") -
If specified, logfiles are written into this directory instead -of the default logging directory. -
v (int, default=0) -
Show all VLOG(m) messages for m less or -equal the value of this flag. Overridable by --vmodule. -See the section about verbose logging for more -detail. -
vmodule (string, default="") -
Per-module verbose level. The argument has to contain a -comma-separated list of <module name>=<log level>. -<module name> -is a glob pattern (e.g., gfs* for all modules whose name -starts with "gfs"), matched against the filename base -(that is, name ignoring .cc/.h./-inl.h). -<log level> overrides any value given by --v. -See also the section about verbose logging. -
- -

There are some other flags defined in logging.cc. Please grep the -source code for "DEFINE_" to see a complete list of all flags. - -

You can also modify flag values in your program by modifying global -variables FLAGS_* . Most settings start working -immediately after you update FLAGS_* . The exceptions are -the flags related to destination files. For example, you might want to -set FLAGS_log_dir before -calling google::InitGoogleLogging . Here is an example: - -

-   LOG(INFO) << "file";
-   // Most flags work immediately after updating values.
-   FLAGS_logtostderr = 1;
-   LOG(INFO) << "stderr";
-   FLAGS_logtostderr = 0;
-   // This won't change the log destination. If you want to set this
-   // value, you should do this before google::InitGoogleLogging .
-   FLAGS_log_dir = "/some/log/directory";
-   LOG(INFO) << "the same file";
-
- -

Conditional / Occasional Logging

- -

Sometimes, you may only want to log a message under certain -conditions. You can use the following macros to perform conditional -logging: - -

-   LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
-
- -The "Got lots of cookies" message is logged only when the variable -num_cookies exceeds 10. - -If a line of code is executed many times, it may be useful to only log -a message at certain intervals. This kind of logging is most useful -for informational messages. - -
-   LOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";
-
- -

The above line outputs a log messages on the 1st, 11th, -21st, ... times it is executed. Note that the special -google::COUNTER value is used to identify which repetition is -happening. - -

You can combine conditional and occasional logging with the -following macro. - -

-   LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << google::COUNTER
-                                           << "th big cookie";
-
- -

Instead of outputting a message every nth time, you can also limit -the output to the first n occurrences: - -

-   LOG_FIRST_N(INFO, 20) << "Got the " << google::COUNTER << "th cookie";
-
- -

Outputs log messages for the first 20 times it is executed. Again, -the google::COUNTER identifier indicates which repetition is -happening. - -

Debug Mode Support

- -

Special "debug mode" logging macros only have an effect in debug -mode and are compiled away to nothing for non-debug mode -compiles. Use these macros to avoid slowing down your production -application due to excessive logging. - -

-   DLOG(INFO) << "Found cookies";
-
-   DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
-
-   DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";
-
- -

CHECK Macros

- -

It is a good practice to check expected conditions in your program -frequently to detect errors as early as possible. The -CHECK macro provides the ability to abort the application -when a condition is not met, similar to the assert macro -defined in the standard C library. - -

CHECK aborts the application if a condition is not -true. Unlike assert, it is *not* controlled by -NDEBUG, so the check will be executed regardless of -compilation mode. Therefore, fp->Write(x) in the -following example is always executed: - -

-   CHECK(fp->Write(x) == 4) << "Write failed!";
-
- -

There are various helper macros for -equality/inequality checks - CHECK_EQ, -CHECK_NE, CHECK_LE, CHECK_LT, -CHECK_GE, and CHECK_GT. -They compare two values, and log a -FATAL message including the two values when the result is -not as expected. The values must have operator<<(ostream, -...) defined. - -

You may append to the error message like so: - -

-   CHECK_NE(1, 2) << ": The world must be ending!";
-
- -

We are very careful to ensure that each argument is evaluated exactly -once, and that anything which is legal to pass as a function argument is -legal here. In particular, the arguments may be temporary expressions -which will end up being destroyed at the end of the apparent statement, -for example: - -

-   CHECK_EQ(string("abc")[1], 'b');
-
- -

The compiler reports an error if one of the arguments is a -pointer and the other is NULL. To work around this, simply static_cast -NULL to the type of the desired pointer. - -

-   CHECK_EQ(some_ptr, static_cast<SomeType*>(NULL));
-
- -

Better yet, use the CHECK_NOTNULL macro: - -

-   CHECK_NOTNULL(some_ptr);
-   some_ptr->DoSomething();
-
- -

Since this macro returns the given pointer, this is very useful in -constructor initializer lists. - -

-   struct S {
-     S(Something* ptr) : ptr_(CHECK_NOTNULL(ptr)) {}
-     Something* ptr_;
-   };
-
- -

Note that you cannot use this macro as a C++ stream due to this -feature. Please use CHECK_EQ described above to log a -custom message before aborting the application. - -

If you are comparing C strings (char *), a handy set of macros -performs case sensitive as well as case insensitive comparisons - -CHECK_STREQ, CHECK_STRNE, -CHECK_STRCASEEQ, and CHECK_STRCASENE. The -CASE versions are case-insensitive. You can safely pass NULL -pointers for this macro. They treat NULL and any -non-NULL string as not equal. Two NULLs are -equal. - -

Note that both arguments may be temporary strings which are -destructed at the end of the current "full expression" -(e.g., CHECK_STREQ(Foo().c_str(), Bar().c_str()) where -Foo and Bar return C++'s -std::string). - -

The CHECK_DOUBLE_EQ macro checks the equality of two -floating point values, accepting a small error margin. -CHECK_NEAR accepts a third floating point argument, which -specifies the acceptable error margin. - -

Verbose Logging

- -

When you are chasing difficult bugs, thorough log messages are very -useful. However, you may want to ignore too verbose messages in usual -development. For such verbose logging, glog provides the -VLOG macro, which allows you to define your own numeric -logging levels. The --v command line option controls -which verbose messages are logged: - -

-   VLOG(1) << "I'm printed when you run the program with --v=1 or higher";
-   VLOG(2) << "I'm printed when you run the program with --v=2 or higher";
-
- -

With VLOG, the lower the verbose level, the more -likely messages are to be logged. For example, if ---v==1, VLOG(1) will log, but -VLOG(2) will not log. This is opposite of the severity -level, where INFO is 0, and ERROR is 2. ---minloglevel of 1 will log WARNING and -above. Though you can specify any integers for both VLOG -macro and --v flag, the common values for them are small -positive integers. For example, if you write VLOG(0), -you should specify --v=-1 or lower to silence it. This -is less useful since we may not want verbose logs by default in most -cases. The VLOG macros always log at the -INFO log level (when they log at all). - -

Verbose logging can be controlled from the command line on a -per-module basis: - -

-   --vmodule=mapreduce=2,file=1,gfs*=3 --v=0
-
- -

will: - -

    -
  • a. Print VLOG(2) and lower messages from mapreduce.{h,cc} -
  • b. Print VLOG(1) and lower messages from file.{h,cc} -
  • c. Print VLOG(3) and lower messages from files prefixed with "gfs" -
  • d. Print VLOG(0) and lower messages from elsewhere -
- -

The wildcarding functionality shown by (c) supports both '*' -(matches 0 or more characters) and '?' (matches any single character) -wildcards. Please also check the section about command line flags. - -

There's also VLOG_IS_ON(n) "verbose level" condition -macro. This macro returns true when the --v is equal or -greater than n. To be used as - -

-   if (VLOG_IS_ON(2)) {
-     // do some logging preparation and logging
-     // that can't be accomplished with just VLOG(2) << ...;
-   }
-
- -

Verbose level condition macros VLOG_IF, -VLOG_EVERY_N and VLOG_IF_EVERY_N behave -analogous to LOG_IF, LOG_EVERY_N, -LOF_IF_EVERY, but accept a numeric verbosity level as -opposed to a severity level. - -

-   VLOG_IF(1, (size > 1024))
-      << "I'm printed when size is more than 1024 and when you run the "
-         "program with --v=1 or more";
-   VLOG_EVERY_N(1, 10)
-      << "I'm printed every 10th occurrence, and when you run the program "
-         "with --v=1 or more. Present occurence is " << google::COUNTER;
-   VLOG_IF_EVERY_N(1, (size > 1024), 10)
-      << "I'm printed on every 10th occurence of case when size is more "
-         " than 1024, when you run the program with --v=1 or more. ";
-         "Present occurence is " << google::COUNTER;
-
- -

Failure Signal Handler

- -

-The library provides a convenient signal handler that will dump useful -information when the program crashes on certain signals such as SIGSEGV. -The signal handler can be installed by -google::InstallFailureSignalHandler(). The following is an example of output -from the signal handler. - -

-*** Aborted at 1225095260 (unix time) try "date -d @1225095260" if you are using GNU date ***
-*** SIGSEGV (@0x0) received by PID 17711 (TID 0x7f893090a6f0) from PID 0; stack trace: ***
-PC: @           0x412eb1 TestWaitingLogSink::send()
-    @     0x7f892fb417d0 (unknown)
-    @           0x412eb1 TestWaitingLogSink::send()
-    @     0x7f89304f7f06 google::LogMessage::SendToLog()
-    @     0x7f89304f35af google::LogMessage::Flush()
-    @     0x7f89304f3739 google::LogMessage::~LogMessage()
-    @           0x408cf4 TestLogSinkWaitTillSent()
-    @           0x4115de main
-    @     0x7f892f7ef1c4 (unknown)
-    @           0x4046f9 (unknown)
-
- -

-By default, the signal handler writes the failure dump to the standard -error. You can customize the destination by InstallFailureWriter(). - -

Miscellaneous Notes

- -

Performance of Messages

- -

The conditional logging macros provided by glog (e.g., -CHECK, LOG_IF, VLOG, ...) are -carefully implemented and don't execute the right hand side -expressions when the conditions are false. So, the following check -may not sacrifice the performance of your application. - -

-   CHECK(obj.ok) << obj.CreatePrettyFormattedStringButVerySlow();
-
- -

User-defined Failure Function

- -

FATAL severity level messages or unsatisfied -CHECK condition terminate your program. You can change -the behavior of the termination by -InstallFailureFunction. - -

-   void YourFailureFunction() {
-     // Reports something...
-     exit(1);
-   }
-
-   int main(int argc, char* argv[]) {
-     google::InstallFailureFunction(&YourFailureFunction);
-   }
-
- -

By default, glog tries to dump stacktrace and makes the program -exit with status 1. The stacktrace is produced only when you run the -program on an architecture for which glog supports stack tracing (as -of September 2008, glog supports stack tracing for x86 and x86_64). - -

Raw Logging

- -

The header file <glog/raw_logging.h> can be -used for thread-safe logging, which does not allocate any memory or -acquire any locks. Therefore, the macros defined in this -header file can be used by low-level memory allocation and -synchronization code. -Please check src/glog/raw_logging.h.in for detail. -

- -

Google Style perror()

- -

PLOG() and PLOG_IF() and -PCHECK() behave exactly like their LOG* and -CHECK equivalents with the addition that they append a -description of the current state of errno to their output lines. -E.g. - -

-   PCHECK(write(1, NULL, 2) >= 0) << "Write NULL failed";
-
- -

This check fails with the following error message. - -

-   F0825 185142 test.cc:22] Check failed: write(1, NULL, 2) >= 0 Write NULL failed: Bad address [14]
-
- -

Syslog

- -

SYSLOG, SYSLOG_IF, and -SYSLOG_EVERY_N macros are available. -These log to syslog in addition to the normal logs. Be aware that -logging to syslog can drastically impact performance, especially if -syslog is configured for remote logging! Make sure you understand the -implications of outputting to syslog before you use these macros. In -general, it's wise to use these macros sparingly. - -

Strip Logging Messages

- -

Strings used in log messages can increase the size of your binary -and present a privacy concern. You can therefore instruct glog to -remove all strings which fall below a certain severity level by using -the GOOGLE_STRIP_LOG macro: - -

If your application has code like this: - -

-   #define GOOGLE_STRIP_LOG 1    // this must go before the #include!
-   #include <glog/logging.h>
-
- -

The compiler will remove the log messages whose severities are less -than the specified integer value. Since -VLOG logs at the severity level INFO -(numeric value 0), -setting GOOGLE_STRIP_LOG to 1 or greater removes -all log messages associated with VLOGs as well as -INFO log statements. - -

Automatically Remove Old Logs

- -

To enable the log cleaner: - -

-google::EnableLogCleaner(3); // keep your logs for 3 days
-
- -And then Google glog will check if there are overdue logs whenever -a flush is performed. In this example, any log file from your project whose -last modified time is greater than 3 days will be unlink()ed. - -

This feature can be disabled at any time (if it has been enabled) - -

-google::DisableLogCleaner();
-
- -

Notes for Windows users

- -

Google glog defines a severity level ERROR, which is -also defined in windows.h . You can make glog not define -INFO, WARNING, ERROR, -and FATAL by defining -GLOG_NO_ABBREVIATED_SEVERITIES before -including glog/logging.h . Even with this macro, you can -still use the iostream like logging facilities: - -

-  #define GLOG_NO_ABBREVIATED_SEVERITIES
-  #include <windows.h>
-  #include <glog/logging.h>
-
-  // ...
-
-  LOG(ERROR) << "This should work";
-  LOG_IF(ERROR, x > y) << "This should be also OK";
-
- -

-However, you cannot -use INFO, WARNING, ERROR, -and FATAL anymore for functions defined -in glog/logging.h . - -

-  #define GLOG_NO_ABBREVIATED_SEVERITIES
-  #include <windows.h>
-  #include <glog/logging.h>
-
-  // ...
-
-  // This won't work.
-  // google::FlushLogFiles(google::ERROR);
-
-  // Use this instead.
-  google::FlushLogFiles(google::GLOG_ERROR);
-
- -

-If you don't need ERROR defined -by windows.h, there are a couple of more workarounds -which sometimes don't work: - -

    -
  • #define WIN32_LEAN_AND_MEAN or NOGDI - before you #include windows.h . -
  • #undef ERROR after you #include - windows.h . -
- -

See -this issue for more detail. - -


-
-Shinichiro Hamaji
-Gregor Hohpe
- -
- - - diff --git a/m4/ac_have_attribute.m4 b/m4/ac_have_attribute.m4 deleted file mode 100644 index 19f4021e9..000000000 --- a/m4/ac_have_attribute.m4 +++ /dev/null @@ -1,16 +0,0 @@ -AC_DEFUN([AX_C___ATTRIBUTE__], [ - AC_MSG_CHECKING(for __attribute__) - AC_CACHE_VAL(ac_cv___attribute__, [ - AC_TRY_COMPILE( - [#include - 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__) -]) diff --git a/m4/ac_have_builtin_expect.m4 b/m4/ac_have_builtin_expect.m4 deleted file mode 100644 index e91b6fd98..000000000 --- a/m4/ac_have_builtin_expect.m4 +++ /dev/null @@ -1,14 +0,0 @@ -AC_DEFUN([AX_C___BUILTIN_EXPECT], [ - AC_MSG_CHECKING(for __builtin_expect) - AC_CACHE_VAL(ac_cv___builtin_expect, [ - AC_TRY_COMPILE( - [int foo(void) { if (__builtin_expect(0, 0)) return 1; return 0; }], - [], - ac_cv___builtin_expect=yes, - ac_cv___builtin_expect=no - )]) - if test "$ac_cv___builtin_expect" = "yes"; then - AC_DEFINE(HAVE___BUILTIN_EXPECT, 1, [define if your compiler has __builtin_expect]) - fi - AC_MSG_RESULT($ac_cv___builtin_expect) -]) diff --git a/m4/ac_have_sync_val_compare_and_swap.m4 b/m4/ac_have_sync_val_compare_and_swap.m4 deleted file mode 100644 index 88b027e23..000000000 --- a/m4/ac_have_sync_val_compare_and_swap.m4 +++ /dev/null @@ -1,14 +0,0 @@ -AC_DEFUN([AX_C___SYNC_VAL_COMPARE_AND_SWAP], [ - AC_MSG_CHECKING(for __sync_val_compare_and_swap) - AC_CACHE_VAL(ac_cv___sync_val_compare_and_swap, [ - AC_TRY_LINK( - [], - [int a; if (__sync_val_compare_and_swap(&a, 0, 1)) return 1; return 0;], - ac_cv___sync_val_compare_and_swap=yes, - ac_cv___sync_val_compare_and_swap=no - )]) - if test "$ac_cv___sync_val_compare_and_swap" = "yes"; then - AC_DEFINE(HAVE___SYNC_VAL_COMPARE_AND_SWAP, 1, [define if your compiler has __sync_val_compare_and_swap]) - fi - AC_MSG_RESULT($ac_cv___sync_val_compare_and_swap) -]) diff --git a/m4/ac_rwlock.m4 b/m4/ac_rwlock.m4 deleted file mode 100644 index 5065bcc1c..000000000 --- a/m4/ac_rwlock.m4 +++ /dev/null @@ -1,31 +0,0 @@ -# TODO(csilvers): it would be better to actually try to link against -# -pthreads, to make sure it defines these methods, but that may be -# too hard, since pthread support is really tricky. - -# Check for support for pthread_rwlock_init() etc. -# These aren't posix, but are widely supported. To get them on linux, -# you need to define _XOPEN_SOURCE first, so this check assumes your -# application does that. -# -# Note: OS X (as of 6/1/06) seems to support pthread_rwlock, but -# doesn't define PTHREAD_RWLOCK_INITIALIZER. Therefore, we don't test -# that particularly macro. It's probably best if you don't use that -# macro in your code either. - -AC_DEFUN([AC_RWLOCK], -[AC_CACHE_CHECK(support for pthread_rwlock_* functions, -ac_cv_rwlock, -[AC_LANG_SAVE - AC_LANG_C - AC_TRY_COMPILE([#define _XOPEN_SOURCE 500 - #include ], - [pthread_rwlock_t l; pthread_rwlock_init(&l, NULL); - pthread_rwlock_rdlock(&l); - return 0;], - ac_cv_rwlock=yes, ac_cv_rwlock=no) - AC_LANG_RESTORE -]) -if test "$ac_cv_rwlock" = yes; then - AC_DEFINE(HAVE_RWLOCK,1,[define if the compiler implements pthread_rwlock_*]) -fi -]) diff --git a/m4/acx_pthread.m4 b/m4/acx_pthread.m4 deleted file mode 100644 index 2cf20de14..000000000 --- a/m4/acx_pthread.m4 +++ /dev/null @@ -1,363 +0,0 @@ -# This was retrieved from -# http://svn.0pointer.de/viewvc/trunk/common/acx_pthread.m4?revision=1277&root=avahi -# See also (perhaps for new versions?) -# http://svn.0pointer.de/viewvc/trunk/common/acx_pthread.m4?root=avahi -# -# We've rewritten the inconsistency check code (from avahi), to work -# more broadly. In particular, it no longer assumes ld accepts -zdefs. -# This caused a restructing of the code, but the functionality has only -# changed a little. - -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_CFLAGS 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_CC to any special C compiler that is needed for -dnl multi-threaded programs (defaults to the value of CC otherwise). -dnl (This is necessary on AIX to use the special cc_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_CC $CFLAGS $PTHREAD_CFLAGS $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, CFLAGS, and CC: -dnl -dnl LIBS="$PTHREAD_LIBS $LIBS" -dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -dnl CC="$PTHREAD_CC" -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 -dnl @version 2006-05-29 -dnl @license GPLWithACException -dnl -dnl Checks for GCC shared/pthread inconsistency based on work by -dnl Marcin Owsiany - - -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_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - 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_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -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. - -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --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: - - acx_pthread_flags="-pthreads pthread -mt -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_CFLAGS="$flag" - ;; - - pthread-config) - AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) - if test x"$acx_pthread_config" = xno; then continue; fi - PTHREAD_CFLAGS="`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_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # 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_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" - CFLAGS="$save_CFLAGS" - - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_TRY_LINK([#include ], [int attr=$attr; return attr;], - [attr_name=$attr; break]) - done - AC_MSG_RESULT($attr_name) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - 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";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; - esac - AC_MSG_RESULT(${flag}) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - # More AIX lossage: must compile with xlc_r or cc_r - if test x"$GCC" != xyes; then - AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) - else - PTHREAD_CC=$CC - fi - - # The next part tries to detect GCC inconsistency with -shared on some - # architectures and systems. The problem is that in certain - # configurations, when -shared is specified, GCC "forgets" to - # internally use various flags which are still necessary. - - # - # Prepare the flags - # - save_CFLAGS="$CFLAGS" - save_LIBS="$LIBS" - save_CC="$CC" - - # Try with the flags determined by the earlier checks. - # - # -Wl,-z,defs forces link-time symbol resolution, so that the - # linking checks with -shared actually have any value - # - # FIXME: -fPIC is required for -shared on many architectures, - # so we specify it here, but the right way would probably be to - # properly detect whether it is actually required. - CFLAGS="-shared -fPIC -Wl,-z,defs $CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CC="$PTHREAD_CC" - - # In order not to create several levels of indentation, we test - # the value of "$done" until we find the cure or run out of ideas. - done="no" - - # First, make sure the CFLAGS we added are actually accepted by our - # compiler. If not (and OS X's ld, for instance, does not accept -z), - # then we can't do this test. - if test x"$done" = xno; then - AC_MSG_CHECKING([whether to check for GCC pthread/shared inconsistencies]) - AC_TRY_LINK(,, , [done=yes]) - - if test "x$done" = xyes ; then - AC_MSG_RESULT([no]) - else - AC_MSG_RESULT([yes]) - fi - fi - - if test x"$done" = xno; then - AC_MSG_CHECKING([whether -pthread is sufficient with -shared]) - AC_TRY_LINK([#include ], - [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); ], - [done=yes]) - - if test "x$done" = xyes; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - - # - # Linux gcc on some architectures such as mips/mipsel forgets - # about -lpthread - # - if test x"$done" = xno; then - AC_MSG_CHECKING([whether -lpthread fixes that]) - LIBS="-lpthread $PTHREAD_LIBS $save_LIBS" - AC_TRY_LINK([#include ], - [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); ], - [done=yes]) - - if test "x$done" = xyes; then - AC_MSG_RESULT([yes]) - PTHREAD_LIBS="-lpthread $PTHREAD_LIBS" - else - AC_MSG_RESULT([no]) - fi - fi - # - # FreeBSD 4.10 gcc forgets to use -lc_r instead of -lc - # - if test x"$done" = xno; then - AC_MSG_CHECKING([whether -lc_r fixes that]) - LIBS="-lc_r $PTHREAD_LIBS $save_LIBS" - AC_TRY_LINK([#include ], - [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); ], - [done=yes]) - - if test "x$done" = xyes; then - AC_MSG_RESULT([yes]) - PTHREAD_LIBS="-lc_r $PTHREAD_LIBS" - else - AC_MSG_RESULT([no]) - fi - fi - if test x"$done" = xno; then - # OK, we have run out of ideas - AC_MSG_WARN([Impossible to determine how to use pthreads with shared libraries]) - - # so it's not safe to assume that we may use pthreads - acx_pthread_ok=no - fi - - CFLAGS="$save_CFLAGS" - LIBS="$save_LIBS" - CC="$save_CC" -else - PTHREAD_CC="$CC" -fi - -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_CC) - -# 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 diff --git a/m4/google_namespace.m4 b/m4/google_namespace.m4 deleted file mode 100644 index 79e0a6d42..000000000 --- a/m4/google_namespace.m4 +++ /dev/null @@ -1,36 +0,0 @@ -# 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'. - -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) -]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 deleted file mode 100644 index 9000a057d..000000000 --- a/m4/ltsugar.m4 +++ /dev/null @@ -1,123 +0,0 @@ -# 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 -]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 deleted file mode 100644 index c573da90c..000000000 --- a/m4/lt~obsolete.m4 +++ /dev/null @@ -1,98 +0,0 @@ -# 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])]) diff --git a/m4/namespaces.m4 b/m4/namespaces.m4 deleted file mode 100644 index d78dbe4cc..000000000 --- a/m4/namespaces.m4 +++ /dev/null @@ -1,15 +0,0 @@ -# Checks whether the compiler implements namespaces -AC_DEFUN([AC_CXX_NAMESPACES], - [AC_CACHE_CHECK(whether the compiler implements namespaces, - ac_cv_cxx_namespaces, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([namespace Outer { - namespace Inner { int i = 0; }}], - [using namespace Outer::Inner; return i;], - ac_cv_cxx_namespaces=yes, - ac_cv_cxx_namespaces=no) - AC_LANG_RESTORE]) - if test "$ac_cv_cxx_namespaces" = yes; then - AC_DEFINE(HAVE_NAMESPACES, 1, [define if the compiler implements namespaces]) - fi]) diff --git a/m4/pc_from_ucontext.m4 b/m4/pc_from_ucontext.m4 deleted file mode 100644 index daffddb53..000000000 --- a/m4/pc_from_ucontext.m4 +++ /dev/null @@ -1,71 +0,0 @@ -# We want to access the "PC" (Program Counter) register from a struct -# ucontext. Every system has its own way of doing that. We try all the -# possibilities we know about. Note REG_PC should come first (REG_RIP -# is also defined on solaris, but does the wrong thing). - -# OpenBSD doesn't have ucontext.h, but we can get PC from ucontext_t -# by using signal.h. - -# The first argument of AC_PC_FROM_UCONTEXT will be invoked when we -# cannot find a way to obtain PC from ucontext. - -AC_DEFUN([AC_PC_FROM_UCONTEXT], - [AC_CHECK_HEADERS(ucontext.h) - AC_CHECK_HEADERS(sys/ucontext.h) # ucontext on OS X 10.6 (at least) - AC_MSG_CHECKING([how to access the program counter from a struct ucontext]) - pc_fields=" uc_mcontext.gregs[[REG_PC]]" # Solaris x86 (32 + 64 bit) - pc_fields="$pc_fields uc_mcontext.gregs[[REG_EIP]]" # Linux (i386) - pc_fields="$pc_fields uc_mcontext.gregs[[REG_RIP]]" # Linux (x86_64) - pc_fields="$pc_fields uc_mcontext.sc_ip" # Linux (ia64) - pc_fields="$pc_fields uc_mcontext.uc_regs->gregs[[PT_NIP]]" # Linux (ppc) - pc_fields="$pc_fields uc_mcontext.gregs[[R15]]" # Linux (arm old [untested]) - pc_fields="$pc_fields uc_mcontext.arm_pc" # Linux (arm new [untested]) - pc_fields="$pc_fields uc_mcontext.mc_eip" # FreeBSD (i386) - pc_fields="$pc_fields uc_mcontext.mc_rip" # FreeBSD (x86_64 [untested]) - pc_fields="$pc_fields uc_mcontext.__gregs[[_REG_EIP]]" # NetBSD (i386) - pc_fields="$pc_fields uc_mcontext.__gregs[[_REG_RIP]]" # NetBSD (x86_64) - pc_fields="$pc_fields uc_mcontext->ss.eip" # OS X (i386, <=10.4) - pc_fields="$pc_fields uc_mcontext->__ss.__eip" # OS X (i386, >=10.5) - pc_fields="$pc_fields uc_mcontext->ss.rip" # OS X (x86_64) - pc_fields="$pc_fields uc_mcontext->__ss.__rip" # OS X (>=10.5 [untested]) - pc_fields="$pc_fields uc_mcontext->ss.srr0" # OS X (ppc, ppc64 [untested]) - pc_fields="$pc_fields uc_mcontext->__ss.__srr0" # OS X (>=10.5 [untested]) - pc_field_found=false - for pc_field in $pc_fields; do - if ! $pc_field_found; then - if test "x$ac_cv_header_sys_ucontext_h" = xyes; then - AC_TRY_COMPILE([#define _GNU_SOURCE 1 - #include ], - [ucontext_t u; return u.$pc_field == 0;], - AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field, - How to access the PC from a struct ucontext) - AC_MSG_RESULT([$pc_field]) - pc_field_found=true) - else - AC_TRY_COMPILE([#define _GNU_SOURCE 1 - #include ], - [ucontext_t u; return u.$pc_field == 0;], - AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field, - How to access the PC from a struct ucontext) - AC_MSG_RESULT([$pc_field]) - pc_field_found=true) - fi - fi - done - if ! $pc_field_found; then - pc_fields=" sc_eip" # OpenBSD (i386) - pc_fields="$pc_fields sc_rip" # OpenBSD (x86_64) - for pc_field in $pc_fields; do - if ! $pc_field_found; then - AC_TRY_COMPILE([#include ], - [ucontext_t u; return u.$pc_field == 0;], - AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field, - How to access the PC from a struct ucontext) - AC_MSG_RESULT([$pc_field]) - pc_field_found=true) - fi - done - fi - if ! $pc_field_found; then - [$1] - fi]) diff --git a/m4/stl_namespace.m4 b/m4/stl_namespace.m4 deleted file mode 100644 index 989ad8069..000000000 --- a/m4/stl_namespace.m4 +++ /dev/null @@ -1,25 +0,0 @@ -# We check what namespace stl code like vector expects to be executed in - -AC_DEFUN([AC_CXX_STL_NAMESPACE], - [AC_CACHE_CHECK( - what namespace STL code is in, - ac_cv_cxx_stl_namespace, - [AC_REQUIRE([AC_CXX_NAMESPACES]) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([#include ], - [vector t; return 0;], - ac_cv_cxx_stl_namespace=none) - AC_TRY_COMPILE([#include ], - [std::vector t; return 0;], - ac_cv_cxx_stl_namespace=std) - AC_LANG_RESTORE]) - if test "$ac_cv_cxx_stl_namespace" = none; then - AC_DEFINE(STL_NAMESPACE,, - [the namespace where STL code like vector<> is defined]) - fi - if test "$ac_cv_cxx_stl_namespace" = std; then - AC_DEFINE(STL_NAMESPACE,std, - [the namespace where STL code like vector<> is defined]) - fi -]) diff --git a/m4/using_operator.m4 b/m4/using_operator.m4 deleted file mode 100644 index 95a9951eb..000000000 --- a/m4/using_operator.m4 +++ /dev/null @@ -1,15 +0,0 @@ -AC_DEFUN([AC_CXX_USING_OPERATOR], - [AC_CACHE_CHECK( - whether compiler supports using ::operator<<, - ac_cv_cxx_using_operator, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([#include - std::ostream& operator<<(std::ostream&, struct s);], - [using ::operator<<; return 0;], - ac_cv_cxx_using_operator=1, - ac_cv_cxx_using_operator=0) - AC_LANG_RESTORE]) - if test "$ac_cv_cxx_using_operator" = 1; then - AC_DEFINE(HAVE_USING_OPERATOR, 1, [define if the compiler supports using expression for operator]) - fi]) diff --git a/packages/deb.sh b/packages/deb.sh deleted file mode 100755 index a1cdf321e..000000000 --- a/packages/deb.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -e - -# This takes one commandline argument, the name of the package. If no -# name is given, then we'll end up just using the name associated with -# an arbitrary .tar.gz file in the rootdir. That's fine: there's probably -# only one. -# -# Run this from the 'packages' directory, just under rootdir - -## Set LIB to lib if exporting a library, empty-string else -LIB= -#LIB=lib - -PACKAGE="$1" -VERSION="$2" - -# We can only build Debian packages, if the Debian build tools are installed -if [ \! -x /usr/bin/debuild ]; then - echo "Cannot find /usr/bin/debuild. Not building Debian packages." 1>&2 - exit 0 -fi - -# Double-check we're in the packages directory, just under rootdir -if [ \! -r ../Makefile -a \! -r ../INSTALL ]; then - echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 - echo "Also, you must run \"make dist\" before running this script." 1>&2 - exit 0 -fi - -# Find the top directory for this package -topdir="${PWD%/*}" - -# Find the tar archive built by "make dist" -archive="$PACKAGE-$VERSION" -if [ -z "${archive}" ]; then - echo "Cannot find ../$PACKAGE*.tar.gz. Run \"make dist\" first." 1>&2 - exit 0 -fi - -# Create a pristine directory for building the Debian package files -trap 'rm -rf '`pwd`/tmp'; exit $?' EXIT SIGHUP SIGINT SIGTERM - -rm -rf tmp -mkdir -p tmp -cd tmp - -package="google-glog_$VERSION" - -# Debian has very specific requirements about the naming of build -# directories, and tar archives. It also wants to write all generated -# packages to the parent of the source directory. We accommodate these -# requirements by building directly from the tar file. -ln -s "${topdir}/${archive}.tar.gz" "${LIB}${package}.orig.tar.gz" -tar zfx "${LIB}${package}.orig.tar.gz" -mv "${archive}" "${LIB}${package}" -cd "${LIB}${package}" -# This is one of those 'specific requirements': where the deb control files live -cp -a "packages/deb" "debian" - -# Now, we can call Debian's standard build tool -debuild -uc -us -cd ../.. # get back to the original top-level dir - -# We'll put the result in a subdirectory that's named after the OS version -# we've made this .deb file for. -destdir="debian-$(cat /etc/debian_version 2>/dev/null || echo UNKNOWN)" - -rm -rf "$destdir" -mkdir -p "$destdir" -mv $(find tmp -mindepth 1 -maxdepth 1 -type f) "$destdir" - -echo -echo "The Debian package files are located in $PWD/$destdir" diff --git a/packages/deb/README b/packages/deb/README deleted file mode 100644 index 57becfda7..000000000 --- a/packages/deb/README +++ /dev/null @@ -1,7 +0,0 @@ -The list of files here isn't complete. For a step-by-step guide on -how to set this package up correctly, check out - http://www.debian.org/doc/maint-guide/ - -Most of the files that are in this directory are boilerplate. -However, you may need to change the list of binary-arch dependencies -in 'rules'. diff --git a/packages/deb/changelog b/packages/deb/changelog deleted file mode 100644 index 4cbed1bd0..000000000 --- a/packages/deb/changelog +++ /dev/null @@ -1,71 +0,0 @@ -google-glog (0.4.0-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Tue, 22 Jan 2019 21:00:26 +0900 - -google-glog (0.3.5-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Tue, 09 May 2017 16:22:12 +0900 - -google-glog (0.3.4-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Tue, 10 Mar 2015 12:02:20 +0900 - -google-glog (0.3.3-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Fri, 01 Feb 2012 14:54:14 +0900 - -google-glog (0.3.2-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Thu, 12 Jan 2012 17:36:14 +0900 - -google-glog (0.3.1-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Tue, 15 Jun 2010 13:50:47 +0900 - -google-glog (0.3-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Thu, 30 Jul 2009 21:31:35 +0900 - -google-glog (0.2.1-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Fri, 10 Apr 2009 15:24:17 +0900 - -google-glog (0.2-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Fri, 23 Jan 2009 03:14:29 +0900 - -google-glog (0.1.2-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Tue, 18 Nov 2008 20:37:00 +0900 - -google-glog (0.1.1-1) unstable; urgency=low - - * New upstream release. - - -- Google Inc. Wed, 15 Oct 2008 20:38:19 +0900 - -google-glog (0.1-1) unstable; urgency=low - - * Initial release. - - -- Google Inc. Sat, 10 May 2008 12:31:10 +0900 diff --git a/packages/deb/compat b/packages/deb/compat deleted file mode 100644 index b8626c4cf..000000000 --- a/packages/deb/compat +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/packages/deb/control b/packages/deb/control deleted file mode 100644 index 110a72cb3..000000000 --- a/packages/deb/control +++ /dev/null @@ -1,23 +0,0 @@ -Source: google-glog -Priority: optional -Maintainer: Google Inc. -Build-Depends: debhelper (>= 4.0.0), binutils -Standards-Version: 3.6.1 - -Package: libgoogle-glog-dev -Section: libdevel -Architecture: any -Depends: libgoogle-glog0 (= ${Source-Version}) -Description: a library that implements application-level logging. - This library provides logging APIs based on C++-style streams and - various helper macros. The devel package contains static and debug - libraries and header files for developing applications that use the - google-glog package. - -Package: libgoogle-glog0 -Section: libs -Architecture: any -Depends: ${shlibs:Depends} -Description: a library that implements application-level logging. - This library provides logging APIs based on C++-style streams and - various helper macros. diff --git a/packages/deb/copyright b/packages/deb/copyright deleted file mode 100644 index b2ce8e8f0..000000000 --- a/packages/deb/copyright +++ /dev/null @@ -1,35 +0,0 @@ -This package was debianized by Google Inc. on -13 June 2008. - -It was downloaded from https://github.com/google/glog - -Upstream Author: opensource@google.com - -Copyright (c) 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/deb/docs b/packages/deb/docs deleted file mode 100644 index 6da25d4d3..000000000 --- a/packages/deb/docs +++ /dev/null @@ -1,7 +0,0 @@ -AUTHORS -COPYING -ChangeLog -INSTALL -README.md -doc/designstyle.css -doc/glog.html diff --git a/packages/deb/libgoogle-glog-dev.dirs b/packages/deb/libgoogle-glog-dev.dirs deleted file mode 100644 index bddfbf5c1..000000000 --- a/packages/deb/libgoogle-glog-dev.dirs +++ /dev/null @@ -1,4 +0,0 @@ -usr/lib -usr/lib/pkgconfig -usr/include -usr/include/glog diff --git a/packages/deb/libgoogle-glog-dev.install b/packages/deb/libgoogle-glog-dev.install deleted file mode 100644 index 9c61e86ea..000000000 --- a/packages/deb/libgoogle-glog-dev.install +++ /dev/null @@ -1,10 +0,0 @@ -usr/include/glog/* -usr/lib/lib*.so -usr/lib/lib*.a -usr/lib/*.la -usr/lib/pkgconfig/* -debian/tmp/usr/include/glog/* -debian/tmp/usr/lib/lib*.so -debian/tmp/usr/lib/lib*.a -debian/tmp/usr/lib/*.la -debian/tmp/usr/lib/pkgconfig/* diff --git a/packages/deb/libgoogle-glog0.dirs b/packages/deb/libgoogle-glog0.dirs deleted file mode 100644 index 68457717b..000000000 --- a/packages/deb/libgoogle-glog0.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib diff --git a/packages/deb/libgoogle-glog0.install b/packages/deb/libgoogle-glog0.install deleted file mode 100644 index 704ea87ab..000000000 --- a/packages/deb/libgoogle-glog0.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/lib*.so.* -debian/tmp/usr/lib/lib*.so.* diff --git a/packages/deb/rules b/packages/deb/rules deleted file mode 100755 index f520befd2..000000000 --- a/packages/deb/rules +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -# shared library versions, option 1 -#version=2.0.5 -#major=2 -# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so -version=`ls src/.libs/lib*.so.* | \ - awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -major=`ls src/.libs/lib*.so.* | \ - awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` - -config.status: configure - dh_testdir - # Add here commands to configure the package. - CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info - - -build: build-stamp -build-stamp: config.status - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) distclean -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/tmp - $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs ChangeLog - dh_installdocs - dh_installexamples - dh_install --sourcedir=debian/tmp -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_python - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install diff --git a/packages/rpm.sh b/packages/rpm.sh deleted file mode 100755 index e5649a225..000000000 --- a/packages/rpm.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh -e - -# Run this from the 'packages' directory, just under rootdir - -# We can only build rpm packages, if the rpm build tools are installed -if [ \! -x /usr/bin/rpmbuild ] -then - echo "Cannot find /usr/bin/rpmbuild. Not building an rpm." 1>&2 - exit 0 -fi - -# Check the commandline flags -PACKAGE="$1" -VERSION="$2" -fullname="${PACKAGE}-${VERSION}" -archive=../$fullname.tar.gz - -if [ -z "$1" -o -z "$2" ] -then - echo "Usage: $0 " 1>&2 - exit 0 -fi - -# Double-check we're in the packages directory, just under rootdir -if [ \! -r ../Makefile -a \! -r ../INSTALL ] -then - echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 - echo "Also, you must run \"make dist\" before running this script." 1>&2 - exit 0 -fi - -if [ \! -r "$archive" ] -then - echo "Cannot find $archive. Run \"make dist\" first." 1>&2 - exit 0 -fi - -# Create the directory where the input lives, and where the output should live -RPM_SOURCE_DIR="/tmp/rpmsource-$fullname" -RPM_BUILD_DIR="/tmp/rpmbuild-$fullname" - -trap 'rm -rf $RPM_SOURCE_DIR $RPM_BUILD_DIR; exit $?' EXIT SIGHUP SIGINT SIGTERM - -rm -rf "$RPM_SOURCE_DIR" "$RPM_BUILD_DIR" -mkdir "$RPM_SOURCE_DIR" -mkdir "$RPM_BUILD_DIR" - -cp "$archive" "$RPM_SOURCE_DIR"/v"$VERSION".tar.gz - -rpmbuild -bb rpm/rpm.spec \ - --define "NAME $PACKAGE" \ - --define "VERSION $VERSION" \ - --define "_sourcedir $RPM_SOURCE_DIR" \ - --define "_builddir $RPM_BUILD_DIR" \ - --define "_rpmdir $RPM_SOURCE_DIR" - -# We put the output in a directory based on what system we've built for -destdir=rpm-unknown -if [ -r /etc/issue ] -then - grep "Red Hat.*release 7" /etc/issue >/dev/null 2>&1 && destdir=rh7 - grep "Red Hat.*release 8" /etc/issue >/dev/null 2>&1 && destdir=rh8 - grep "Red Hat.*release 9" /etc/issue >/dev/null 2>&1 && destdir=rh9 - if grep Fedora /etc/issue >/dev/null; then - destdir=fc`grep Fedora /etc/issue | cut -d' ' -f 4`; - fi -fi - -rm -rf "$destdir" -mkdir -p "$destdir" -# We want to get not only the main package but devel etc, hence the middle * -mv "$RPM_SOURCE_DIR"/*/"${PACKAGE}"-*"${VERSION}"*.rpm "$destdir" - -echo -echo "The rpm package file(s) are located in $PWD/$destdir" diff --git a/packages/rpm/rpm.spec b/packages/rpm/rpm.spec deleted file mode 100644 index 24ef134df..000000000 --- a/packages/rpm/rpm.spec +++ /dev/null @@ -1,72 +0,0 @@ -%define RELEASE 1 -%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} -%define prefix /usr - -Name: %NAME -Summary: A C++ application logging library -Version: %VERSION -Release: %rel -Group: Development/Libraries -URL: http://github.com/google/glog -License: BSD -Vendor: Google -Packager: Google Inc. -Source: https://github.com/google/glog/archive/v%{VERSION}.tar.gz -Distribution: Redhat 7 and above. -Buildroot: %{_tmppath}/%{name}-root -Prefix: %prefix - -%description -The %name package contains a library that implements application-level -logging. This library provides logging APIs based on C++-style -streams and various helper macros. - -%package devel -Summary: A C++ application logging library -Group: Development/Libraries -Requires: %{NAME} = %{VERSION} - -%description devel -The %name-devel package contains static and debug libraries and header -files for developing applications that use the %name package. - -%changelog - * Wed Mar 26 2008 - - First draft - -%prep -%setup - -%build -./configure -make prefix=%prefix - -%install -rm -rf $RPM_BUILD_ROOT -make prefix=$RPM_BUILD_ROOT%{prefix} install - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) - -## Mark all installed files within /usr/share/doc/{package name} as -## documentation. This depends on the following two lines appearing in -## Makefile.am: -## docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION) -## dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL README.md -%docdir %{prefix}/share/doc/%{NAME}-%{VERSION} -%{prefix}/share/doc/%{NAME}-%{VERSION}/* - -%{prefix}/lib/libglog.so.0 -%{prefix}/lib/libglog.so.0.0.0 - -%files devel -%defattr(-,root,root) - -%{prefix}/include/glog -%{prefix}/lib/libglog.a -%{prefix}/lib/libglog.la -%{prefix}/lib/libglog.so -%{prefix}/lib/pkgconfig/libglog.pc

Introduction