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


git-svn-id: https://gflags.googlecode.com/svn/trunk@40 6586e3c6-dcc4-952a-343f-ff74eb82781d
diff --git a/ChangeLog b/ChangeLog
index fa5599f..a6714b7 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 16002d9..3de309f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -116,27 +116,27 @@
                     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 @@
 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 3eaf258..b44e89b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -75,7 +75,8 @@
   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 @@
 	$(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 @@
 # 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 @@
 
 # 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 @@
 	  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 @@
 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-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 @@
 
 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 @@
 	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_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 @@
 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 bd1bae4..04029ea 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 36c7951..af710a4 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 @@
 # 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 @@
   # 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 @@
 
 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 @@
 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 @@
 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 @@
 
 # Define the identity of the package.
  PACKAGE='gflags'
- VERSION='1.3'
+ VERSION='1.4'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -20564,7 +20564,7 @@
 # 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 @@
 _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 43c7a1f..99476b9 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 84f4e9b..9ff43dd 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 99c10c5..4ae69a6 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 28c47a7..926d54b 100644
--- a/packages/deb/libgflags-dev.install
+++ b/packages/deb/libgflags-dev.install
@@ -3,8 +3,10 @@
 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 ed92752..342ccc4 100644
--- a/packages/rpm/rpm.spec
+++ b/packages/rpm/rpm.spec
@@ -67,9 +67,6 @@
 %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 @@
 %{_libdir}/*.a
 %{_libdir}/*.la
 %{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
diff --git a/src/gflags/gflags.h.in b/src/gflags/gflags.h.in
index 889c3fa..177f663 100644
--- a/src/gflags/gflags.h.in
+++ b/src/gflags/gflags.h.in
@@ -523,6 +523,19 @@
 #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 @@
 #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 14f18d4..582b684 100644
--- a/src/gflags_nc.cc
+++ b/src/gflags_nc.cc
@@ -60,4 +60,10 @@
             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 191c6e3..8782faa 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 @@
 #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 @@
 #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));       \