autogen.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # Run this script to generate the configure script and other files that will
  3. # be included in the distribution. These files are not checked in because they
  4. # are automatically generated.
  5. # Check that we're being run from the right directory.
  6. if test ! -f src/google/protobuf/stubs/common.h; then
  7. cat >&2 << __EOF__
  8. Could not find source code. Make sure you are running this script from the
  9. root of the distribution tree.
  10. __EOF__
  11. exit 1
  12. fi
  13. if test ! -d gtest; then
  14. echo "gtest bundle not present. Downloading gtest-1.3.0 automatically." >&2
  15. set -ex
  16. curl http://googletest.googlecode.com/files/gtest-1.3.0.tar.bz2 | tar jx
  17. mv gtest-1.3.0 gtest
  18. # Temporary hack: Must change C runtime library to "multi-threaded DLL",
  19. # otherwise it will be set to "multi-threaded static" when MSVC upgrades
  20. # the project file to MSVC 2005/2008. vladl of Google Test says gtest will
  21. # probably change their default to match, then this will be unnecessary.
  22. # One of these mappings converts the debug configuration and the other
  23. # converts the release configuration. I don't know which is which.
  24. sed -i -e 's/RuntimeLibrary="5"/RuntimeLibrary="3"/g;
  25. s/RuntimeLibrary="4"/RuntimeLibrary="2"/g;' gtest/msvc/*.vcproj
  26. else
  27. set -ex
  28. fi
  29. # TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings.
  30. autoreconf -f -i -Wall,no-obsolete
  31. rm -rf autom4te.cache config.h.in~
  32. exit 0