autogen.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. set -e
  6. if [ ! -z "$@" ]; then
  7. for argument in "$@"; do
  8. case $argument in
  9. # make curl silent
  10. "-s")
  11. curlopts="-s"
  12. ;;
  13. esac
  14. done
  15. fi
  16. # Check that we're being run from the right directory.
  17. if test ! -f src/google/protobuf/stubs/common.h; then
  18. cat >&2 << __EOF__
  19. Could not find source code. Make sure you are running this script from the
  20. root of the distribution tree.
  21. __EOF__
  22. exit 1
  23. fi
  24. # Check that gmock is present. Usually it is already there since the
  25. # directory is set up as an SVN external.
  26. if test ! -e gmock; then
  27. echo "Google Mock not present. Fetching gmock-1.7.0 from the web..."
  28. curl $curlopts -L -O https://github.com/google/googlemock/archive/release-1.7.0.zip
  29. unzip -q release-1.7.0.zip
  30. rm release-1.7.0.zip
  31. mv googlemock-release-1.7.0 gmock
  32. curl $curlopts -L -O https://github.com/google/googletest/archive/release-1.7.0.zip
  33. unzip -q release-1.7.0.zip
  34. rm release-1.7.0.zip
  35. mv googletest-release-1.7.0 gmock/gtest
  36. fi
  37. set -ex
  38. # TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings.
  39. autoreconf -f -i -Wall,no-obsolete
  40. rm -rf autom4te.cache config.h.in~
  41. exit 0