diff --git a/ChangeLog b/ChangeLog index fa5599f8f87fbe9861fdbc23d3ecc1d18bdf7be7..a6714b7cd1e72a7ab15390b999b58de911927fda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Wed Oct 13 17:40:12 2010 Google Inc. <opensource@google.com> + + * google-gflags: version 1.4 + * Add a check to prevent passing 0 to DEFINE_string (jorg) + * Reduce compile (.o) size (jyrki) + * Some small changes to quiet debug compiles (alexk) + * PORTING: better support static linking on windows (csilvers) + * DOCUMENTATION: change default values, use validators, etc. + * Update the NEWS file to be non-empty + * Add pkg-config (.pc) files for libgflags and libgflags_nothreads + Mon Jan 4 18:09:30 2010 Google Inc. <opensource@google.com> * google-gflags: version 1.3 diff --git a/Makefile.am b/Makefile.am index 16002d95a216a232e319721534bdf0ddd25e2435..3de309f94227c64af303670c0bb560b2dd98f093 100644 --- a/Makefile.am +++ b/Makefile.am @@ -116,27 +116,27 @@ gflags_unittest_sh: gflags_unittest$(EXEEXT) \ gflags_unittest3$(EXEEXT) bash --version >/dev/null 2>&1 && export SH=bash || export SH=sh; \ $$SH "$(top_srcdir)/src/gflags_unittest.sh" \ - "$(PWD)/gflags_unittest" "$(top_srcdir)" "@TEST_TMPDIR@" + "`pwd`/gflags_unittest" "$(top_srcdir)" "@TEST_TMPDIR@" # These are negative-compilation tests. We want to make sure these # erroneous use of the flags macros correctly fail to compile. # Again, we just bother testing with the no-threads version of the library. check_SCRIPTS += gflags_nc_test1 gflags_nc_test1: $(gflagsinclude_HEADERS) src/gflags_nc.cc - ! $(CXX) -DTEST_SWAPPED_ARGS $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test1.o $(srcdir)/src/gflags_nc.cc && echo "Compile failed, like it was supposed to" + if $(CXX) -DTEST_SWAPPED_ARGS $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test1.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi check_SCRIPTS += gflags_nc_test2 gflags_nc_test2: $(gflagsinclude_HEADERS) src/gflags_nc.cc - ! $(CXX) -DTEST_INT_INSTEAD_OF_BOOL $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test2.o $(srcdir)/src/gflags_nc.cc && echo "Compile failed, like it was supposed to" + if $(CXX) -DTEST_INT_INSTEAD_OF_BOOL $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test2.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi check_SCRIPTS += gflags_nc_test3 gflags_nc_test3: $(gflagsinclude_HEADERS) src/gflags_nc.cc - ! $(CXX) -DTEST_BOOL_IN_QUOTES $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test3.o $(srcdir)/src/gflags_nc.cc && echo "Compile failed, like it was supposed to" + if $(CXX) -DTEST_BOOL_IN_QUOTES $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test3.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi # This one, on the other hand, should succeed. check_SCRIPTS += gflags_nc_test4 gflags_nc_test4: $(gflagsinclude_HEADERS) src/gflags_nc.cc - $(CXX) -DSANITY $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test4.o $(srcdir)/src/gflags_nc.cc && echo "Compile failed, like it was supposed to" + $(CXX) -DSANITY $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test4.o $(srcdir)/src/gflags_nc.cc # This file isn't covered under any rule that would cause it to be distributed. dist_noinst_DATA += src/gflags_nc.cc @@ -155,8 +155,37 @@ rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec deb: dist-gzip packages/deb.sh packages/deb/* @cd packages && ./deb.sh ${PACKAGE} ${VERSION} +# http://linux.die.net/man/1/pkg-config, http://pkg-config.freedesktop.org/wiki +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = lib${PACKAGE}.pc lib${PACKAGE}_nothreads.pc +CLEANFILES += $(pkgconfig_DATA) + +# I get the description and URL lines from the rpm spec. I use sed to +# try to rewrite exec_prefix, libdir, and includedir in terms of +# prefix, if possible. +lib${PACKAGE}.pc: Makefile packages/rpm/rpm.spec + echo 'prefix=$(prefix)' > "$@".tmp + echo 'exec_prefix='`echo '$(exec_prefix)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp + echo 'libdir='`echo '$(libdir)' | sed 's@^$(exec_prefix)@$${exec_prefix}@'` >> "$@".tmp + echo 'includedir='`echo '$(includedir)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp + echo '' >> "$@".tmp + echo 'Name: $(PACKAGE)' >> "$@".tmp + echo 'Version: $(VERSION)' >> "$@".tmp + -grep '^Summary:' packages/rpm/rpm.spec | sed s/^Summary:/Description:/ | head -n1 >> "$@".tmp + -grep '^URL: ' packages/rpm/rpm.spec >> "$@".tmp + echo 'Requires:' >> "$@".tmp + echo 'Libs: -L$${libdir} -l$(PACKAGE)' >> "$@".tmp + echo 'Libs.private: $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)' >> "$@".tmp + echo 'Cflags: -I$${includedir}' >> "$@".tmp + mv -f "$@".tmp "$@" + +# The nothreads version is mostly the same +lib${PACKAGE}_nothreads.pc: lib${PACKAGE}.pc + grep -v Libs.private lib${PACKAGE}.pc | sed s/-l$(PACKAGE)/-l$(PACKAGE)_nothreads/ > "$@" + libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck + EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \ libtool $(SCRIPTS) \ src/windows/config.h src/windows/port.h src/windows/port.cc \ diff --git a/Makefile.in b/Makefile.in index 3eaf258a3b59b8f3ff576ba1af2be039383404b1..b44e89b30bda8b7e655e8d91e64b786ccc24d8b6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,8 @@ am__vpath_adj = case $$p in \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(docdir)" "$(DESTDIR)$(gflagsincludedir)" \ + "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(gflagsincludedir)" \ "$(DESTDIR)$(googleincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) @@ -145,7 +146,8 @@ DIST_SOURCES = $(libgflags_la_SOURCES) \ $(gflags_unittest_SOURCES) $(gflags_unittest2_SOURCES) \ $(gflags_unittest3_SOURCES) dist_docDATA_INSTALL = $(INSTALL_DATA) -DATA = $(dist_doc_DATA) $(dist_noinst_DATA) +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_doc_DATA) $(dist_noinst_DATA) $(pkgconfig_DATA) gflagsincludeHEADERS_INSTALL = $(INSTALL_HEADER) googleincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(gflagsinclude_HEADERS) $(googleinclude_HEADERS) @@ -337,7 +339,8 @@ check_SCRIPTS = gflags_unittest_sh gflags_nc_test1 gflags_nc_test2 \ # Every time you add a unittest to check_SCRIPTS, add it here too noinst_SCRIPTS = src/gflags_unittest.sh # Used for auto-generated source files -CLEANFILES = src/gflags_unittest-main.cc src/gflags_unittest_main.cc +CLEANFILES = src/gflags_unittest-main.cc src/gflags_unittest_main.cc \ + $(pkgconfig_DATA) GFLAGS_SOURCES = $(gflagsinclude_HEADERS) src/mutex.h \ src/gflags.cc src/gflags_reporting.cc \ src/gflags_completions.cc @@ -368,6 +371,10 @@ gflags_unittest3_LDADD = libgflags_nothreads.la # This file isn't covered under any rule that would cause it to be distributed. dist_noinst_DATA = src/gflags_unittest_flagfile src/gflags_nc.cc + +# http://linux.die.net/man/1/pkg-config, http://pkg-config.freedesktop.org/wiki +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = lib${PACKAGE}.pc lib${PACKAGE}_nothreads.pc EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \ libtool $(SCRIPTS) \ src/windows/config.h src/windows/port.h src/windows/port.cc \ @@ -665,6 +672,23 @@ uninstall-dist_docDATA: echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ rm -f "$(DESTDIR)$(docdir)/$$f"; \ done +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done install-gflagsincludeHEADERS: $(gflagsinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(gflagsincludedir)" || $(mkdir_p) "$(DESTDIR)$(gflagsincludedir)" @@ -956,7 +980,7 @@ check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \ $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(gflagsincludedir)" "$(DESTDIR)$(googleincludedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(gflagsincludedir)" "$(DESTDIR)$(googleincludedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am @@ -1007,7 +1031,7 @@ info: info-am info-am: install-data-am: install-dist_docDATA install-gflagsincludeHEADERS \ - install-googleincludeHEADERS + install-googleincludeHEADERS install-pkgconfigDATA install-exec-am: install-binSCRIPTS install-libLTLIBRARIES @@ -1039,7 +1063,8 @@ ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-dist_docDATA \ uninstall-gflagsincludeHEADERS uninstall-googleincludeHEADERS \ - uninstall-info-am uninstall-libLTLIBRARIES + uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-pkgconfigDATA .PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \ clean clean-generic clean-libLTLIBRARIES clean-libtool \ @@ -1052,14 +1077,15 @@ uninstall-am: uninstall-binSCRIPTS uninstall-dist_docDATA \ install-data-am install-dist_docDATA install-exec \ install-exec-am install-gflagsincludeHEADERS \ install-googleincludeHEADERS install-info install-info-am \ - install-libLTLIBRARIES install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binSCRIPTS \ - uninstall-dist_docDATA uninstall-gflagsincludeHEADERS \ - uninstall-googleincludeHEADERS uninstall-info-am \ - uninstall-libLTLIBRARIES + install-libLTLIBRARIES install-man install-pkgconfigDATA \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binSCRIPTS uninstall-dist_docDATA \ + uninstall-gflagsincludeHEADERS uninstall-googleincludeHEADERS \ + uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-pkgconfigDATA src/gflags_unittest-main.cc: src/gflags_unittest.cc rm -f src/gflags_unittest-main.cc @@ -1072,15 +1098,15 @@ gflags_unittest_sh: gflags_unittest$(EXEEXT) \ gflags_unittest3$(EXEEXT) bash --version >/dev/null 2>&1 && export SH=bash || export SH=sh; \ $$SH "$(top_srcdir)/src/gflags_unittest.sh" \ - "$(PWD)/gflags_unittest" "$(top_srcdir)" "@TEST_TMPDIR@" + "`pwd`/gflags_unittest" "$(top_srcdir)" "@TEST_TMPDIR@" gflags_nc_test1: $(gflagsinclude_HEADERS) src/gflags_nc.cc - ! $(CXX) -DTEST_SWAPPED_ARGS $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test1.o $(srcdir)/src/gflags_nc.cc && echo "Compile failed, like it was supposed to" + if $(CXX) -DTEST_SWAPPED_ARGS $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test1.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi gflags_nc_test2: $(gflagsinclude_HEADERS) src/gflags_nc.cc - ! $(CXX) -DTEST_INT_INSTEAD_OF_BOOL $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test2.o $(srcdir)/src/gflags_nc.cc && echo "Compile failed, like it was supposed to" + if $(CXX) -DTEST_INT_INSTEAD_OF_BOOL $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test2.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi gflags_nc_test3: $(gflagsinclude_HEADERS) src/gflags_nc.cc - ! $(CXX) -DTEST_BOOL_IN_QUOTES $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test3.o $(srcdir)/src/gflags_nc.cc && echo "Compile failed, like it was supposed to" + if $(CXX) -DTEST_BOOL_IN_QUOTES $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test3.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi gflags_nc_test4: $(gflagsinclude_HEADERS) src/gflags_nc.cc - $(CXX) -DSANITY $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test4.o $(srcdir)/src/gflags_nc.cc && echo "Compile failed, like it was supposed to" + $(CXX) -DSANITY $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test4.o $(srcdir)/src/gflags_nc.cc rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec @cd packages && ./rpm.sh ${PACKAGE} ${VERSION} @@ -1088,6 +1114,29 @@ rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec deb: dist-gzip packages/deb.sh packages/deb/* @cd packages && ./deb.sh ${PACKAGE} ${VERSION} +# I get the description and URL lines from the rpm spec. I use sed to +# try to rewrite exec_prefix, libdir, and includedir in terms of +# prefix, if possible. +lib${PACKAGE}.pc: Makefile packages/rpm/rpm.spec + echo 'prefix=$(prefix)' > "$@".tmp + echo 'exec_prefix='`echo '$(exec_prefix)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp + echo 'libdir='`echo '$(libdir)' | sed 's@^$(exec_prefix)@$${exec_prefix}@'` >> "$@".tmp + echo 'includedir='`echo '$(includedir)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp + echo '' >> "$@".tmp + echo 'Name: $(PACKAGE)' >> "$@".tmp + echo 'Version: $(VERSION)' >> "$@".tmp + -grep '^Summary:' packages/rpm/rpm.spec | sed s/^Summary:/Description:/ | head -n1 >> "$@".tmp + -grep '^URL: ' packages/rpm/rpm.spec >> "$@".tmp + echo 'Requires:' >> "$@".tmp + echo 'Libs: -L$${libdir} -l$(PACKAGE)' >> "$@".tmp + echo 'Libs.private: $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)' >> "$@".tmp + echo 'Cflags: -I$${includedir}' >> "$@".tmp + mv -f "$@".tmp "$@" + +# The nothreads version is mostly the same +lib${PACKAGE}_nothreads.pc: lib${PACKAGE}.pc + grep -v Libs.private lib${PACKAGE}.pc | sed s/-l$(PACKAGE)/-l$(PACKAGE)_nothreads/ > "$@" + libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/NEWS b/NEWS index bd1bae419e8b8fbb2e0a97f920e628b15c039f70..04029ea4402afb66379a98b14331a3ab1aaf3b3b 100644 --- a/NEWS +++ b/NEWS @@ -1,13 +1,20 @@ -==4 January 2010== +==11 October 2010== + +I've just released gflags 1.4. This release has only minor changes +from 1.3, including some documentation tweaks and some work to make +the library smaller. If 1.3 is working well for you, there's no +particular reason to upgrade. + +===4 January 2010=== I've just released gflags 1.3. gflags now compiles under MSVC, and all tests pass. I *really* never thought non-unix-y Windows folks would want gflags, but at least some of them do. The major news, though, is that I've separated out the python package -into its own library, [http://code.google.com/p/python-gflags -python-gflags]. If you're interested in the Python version of gflags, -that's the place to get it now. +into its own library, [http://code.google.com/p/python-gflags python-gflags]. +If you're interested in the Python version of gflags, that's the place to +get it now. ===10 September 2009== diff --git a/configure b/configure index 36c795122d6dfa41218ef771679dbc614295061b..af710a41ec3d0a62804a431f461dc0516c024948 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for gflags 1.3. +# Generated by GNU Autoconf 2.64 for gflags 1.4. # # Report bugs to <opensource@google.com>. # @@ -703,8 +703,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gflags' PACKAGE_TARNAME='gflags' -PACKAGE_VERSION='1.3' -PACKAGE_STRING='gflags 1.3' +PACKAGE_VERSION='1.4' +PACKAGE_STRING='gflags 1.4' PACKAGE_BUGREPORT='opensource@google.com' PACKAGE_URL='' @@ -1439,7 +1439,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gflags 1.3 to adapt to many kinds of systems. +\`configure' configures gflags 1.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1509,7 +1509,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gflags 1.3:";; + short | recursive ) echo "Configuration of gflags 1.4:";; esac cat <<\_ACEOF @@ -1618,7 +1618,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gflags configure 1.3 +gflags configure 1.4 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2248,7 +2248,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gflags $as_me 1.3, which was +It was created by gflags $as_me 1.4, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -2910,7 +2910,7 @@ fi # Define the identity of the package. PACKAGE='gflags' - VERSION='1.3' + VERSION='1.4' cat >>confdefs.h <<_ACEOF @@ -20564,7 +20564,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gflags $as_me 1.3, which was +This file was extended by gflags $as_me 1.4, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20628,7 +20628,7 @@ Report bugs to <opensource@google.com>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -gflags config.status 1.3 +gflags config.status 1.4 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 43c7a1ffae1a585101c125bb9c860cf6ba3737ed..99476b9d6c1bb0b3fe5a9e80d417a8cee588687e 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ # make sure we're interpreted by some minimal autoconf AC_PREREQ(2.57) -AC_INIT(gflags, 1.3, opensource@google.com) +AC_INIT(gflags, 1.4, opensource@google.com) # The argument here is just something that should be in the current directory # (for sanity checking) AC_CONFIG_SRCDIR(README) diff --git a/packages/deb/changelog b/packages/deb/changelog index 84f4e9bd25b519b77c9151a39ece905c9dedd937..9ff43ddf2898ebddd5bb66bca0a59a2cfbc304e3 100644 --- a/packages/deb/changelog +++ b/packages/deb/changelog @@ -1,3 +1,15 @@ +gflags (1.4-2) unstable; urgency=low + + * Accidentally uploaded an outdated .deb to Google Code; this is the right one + + -- Google Inc. <opensource@google.com> Wed, 13 Oct 2010 17:48:44 -0700 + +gflags (1.4-1) unstable; urgency=low + + * New upstream release. + + -- Google Inc. <opensource@google.com> Wed, 13 Oct 2010 17:40:12 -0700 + gflags (1.3-1) unstable; urgency=low * New upstream release. diff --git a/packages/deb/libgflags-dev.dirs b/packages/deb/libgflags-dev.dirs index 99c10c5a345b67b25004ad9d47e22432b27b9817..4ae69a66586d55e3c14cc2c81b397e7b9189a305 100644 --- a/packages/deb/libgflags-dev.dirs +++ b/packages/deb/libgflags-dev.dirs @@ -1,4 +1,5 @@ usr/lib +usr/lib/pkgconfig usr/include usr/include/google usr/include/gflags diff --git a/packages/deb/libgflags-dev.install b/packages/deb/libgflags-dev.install index 28c47a7ba0b9dc4e6de9f1954a3c8924c07cbeaf..926d54b733004c2088cc368b98e345d8c10c1612 100644 --- a/packages/deb/libgflags-dev.install +++ b/packages/deb/libgflags-dev.install @@ -3,8 +3,10 @@ usr/include/gflags/* usr/lib/lib*.so usr/lib/lib*.a usr/lib/*.la +usr/lib/pkgconfig/*.pc debian/tmp/usr/include/google/* debian/tmp/usr/include/gflags/* debian/tmp/usr/lib/lib*.so debian/tmp/usr/lib/lib*.a debian/tmp/usr/lib/*.la +debian/tmp/usr/lib/pkgconfig/*.pc diff --git a/packages/rpm/rpm.spec b/packages/rpm/rpm.spec index ed927527b3141cab1e50a3eb58d377ff4a275b67..342ccc4f7b6962795cf310a638d87dc09c93ad1a 100644 --- a/packages/rpm/rpm.spec +++ b/packages/rpm/rpm.spec @@ -67,9 +67,6 @@ rm -rf $RPM_BUILD_ROOT %docdir %{prefix}/share/doc/%{NAME}-%{VERSION} %{prefix}/share/doc/%{NAME}-%{VERSION}/* -%doc AUTHORS COPYING ChangeLog INSTALL NEWS README -%doc doc/* - %{_libdir}/*.so.* %{_bindir}/gflags_completions.sh @@ -81,3 +78,4 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/*.a %{_libdir}/*.la %{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc diff --git a/src/gflags/gflags.h.in b/src/gflags/gflags.h.in index 889c3fa9a767724e38f4d787b97dcd46df22bcb5..177f66325d2c03d08f558e4491f334582b4bd5d6 100644 --- a/src/gflags/gflags.h.in +++ b/src/gflags/gflags.h.in @@ -523,6 +523,19 @@ bool IsBoolFlag(bool from); #define DECLARE_string(name) namespace fLS { extern std::string& FLAGS_##name; } \ using fLS::FLAGS_##name +namespace fLS { +inline std::string* dont_pass0toDEFINE_string(char *stringspot, + const char *value) { + return new(stringspot) std::string(value); +} +inline std::string* dont_pass0toDEFINE_string(char *stringspot, + const std::string &value) { + return new(stringspot) std::string(value); +} +inline std::string* dont_pass0toDEFINE_string(char *stringspot, + int value); +} // namespace fLS + // We need to define a var named FLAGS_no##name so people don't define // --string and --nostring. And we need a temporary place to put val // so we don't have to evaluate it twice. Two great needs that go @@ -533,7 +546,9 @@ bool IsBoolFlag(bool from); #define DEFINE_string(name, val, txt) \ namespace fLS { \ static union { void* align; char s[sizeof(std::string)]; } s_##name[2]; \ - std::string* const FLAGS_no##name = new (s_##name[0].s) std::string(val); \ + std::string* const FLAGS_no##name = ::fLS:: \ + dont_pass0toDEFINE_string(s_##name[0].s, \ + val); \ static @ac_google_namespace@::FlagRegisterer o_##name( \ #name, "string", MAYBE_STRIPPED_HELP(txt), __FILE__, \ s_##name[0].s, new (s_##name[1].s) std::string(*FLAGS_no##name)); \ diff --git a/src/gflags_nc.cc b/src/gflags_nc.cc index 14f18d408fb19413c686df919decdd2a5138651d..582b6842054a24916884ac7c8de9d526d73f504d 100644 --- a/src/gflags_nc.cc +++ b/src/gflags_nc.cc @@ -60,4 +60,10 @@ DEFINE_bool(some_bool_flag_4, true, "this is the correct usage of DEFINE_bool"); +#elif defined(TEST_DEFINE_STRING_WITH_0) + +DEFINE_string(some_string_flag, + 0, + "Trying to construct a string by passing 0 would cause a crash."); + #endif diff --git a/src/windows/gflags/gflags.h b/src/windows/gflags/gflags.h index 191c6e3d2bd065ab78c832a7b9f2c5311f3c2904..8782faac95de19181d22259dd1f25a48bfa70519 100644 --- a/src/windows/gflags/gflags.h +++ b/src/windows/gflags/gflags.h @@ -104,7 +104,7 @@ # define GFLAGS_DLL_DECL __declspec(dllimport) # endif # ifndef GFLAGS_DLL_DECLARE_FLAG -# define GFLAGS_DLL_DECLARE_FLAG __declspec(import) +# define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) # endif # ifndef GFLAGS_DLL_DEFINE_FLAG # define GFLAGS_DLL_DEFINE_FLAG __declspec(dllexport) @@ -548,6 +548,19 @@ GFLAGS_DLL_DECL bool IsBoolFlag(bool from); #define DECLARE_string(name) namespace fLS { extern GFLAGS_DLL_DECLARE_FLAG std::string& FLAGS_##name; } \ using fLS::FLAGS_##name +namespace fLS { +inline std::string* dont_pass0toDEFINE_string(char *stringspot, + const char *value) { + return new(stringspot) std::string(value); +} +inline std::string* dont_pass0toDEFINE_string(char *stringspot, + const std::string &value) { + return new(stringspot) std::string(value); +} +inline std::string* dont_pass0toDEFINE_string(char *stringspot, + int value); +} // namespace fLS + // We need to define a var named FLAGS_no##name so people don't define // --string and --nostring. And we need a temporary place to put val // so we don't have to evaluate it twice. Two great needs that go @@ -558,7 +571,9 @@ GFLAGS_DLL_DECL bool IsBoolFlag(bool from); #define DEFINE_string(name, val, txt) \ namespace fLS { \ static union { void* align; char s[sizeof(std::string)]; } s_##name[2]; \ - std::string* const FLAGS_no##name = new (s_##name[0].s) std::string(val); \ + std::string* const FLAGS_no##name = ::fLS:: \ + dont_pass0toDEFINE_string(s_##name[0].s, \ + val); \ static ::google::FlagRegisterer o_##name( \ #name, "string", MAYBE_STRIPPED_HELP(txt), __FILE__, \ s_##name[0].s, new (s_##name[1].s) std::string(*FLAGS_no##name)); \