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