1#!/bin/sh
2
3# Run this script to generate the configure script and other files that will
4# be included in the distribution.  These files are not checked in because they
5# are automatically generated.
6
7set -e
8
9if [ ! -z "$@" ]; then
10  for argument in "$@"; do
11    case $argument in
12	  # make curl silent
13      "-s")
14        curlopts="-s"
15        ;;
16    esac
17  done
18fi
19
20# Check that we're being run from the right directory.
21if test ! -f src/google/protobuf/stubs/common.h; then
22  cat >&2 << __EOF__
23Could not find source code.  Make sure you are running this script from the
24root of the distribution tree.
25__EOF__
26  exit 1
27fi
28
29set -ex
30
31# The absence of a m4 directory in googletest causes autoreconf to fail when
32# building under the CentOS docker image. It's a warning in regular build on
33# Ubuntu/gLinux as well. (This is only needed if git submodules have been
34# initialized, which is typically only needed for testing; see the installation
35# instructions for details.)
36if test -d third_party/googletest; then
37  mkdir -p third_party/googletest/m4
38fi
39
40# TODO(kenton):  Remove the ",no-obsolete" part and fix the resulting warnings.
41autoreconf -f -i -Wall,no-obsolete
42
43rm -rf autom4te.cache config.h.in~
44exit 0
45