blob: c3e026d243464673be13cddf34469f7becb153b3 [file] [log] [blame]
Wink Savillefbaaef92010-05-27 16:25:37 -07001#!/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
Wink Savilled0332952010-05-29 13:00:38 -07007set -e
8
Wink Savillefbaaef92010-05-27 16:25:37 -07009# Check that we're being run from the right directory.
10if test ! -f src/google/protobuf/stubs/common.h; then
11 cat >&2 << __EOF__
12Could not find source code. Make sure you are running this script from the
13root of the distribution tree.
14__EOF__
15 exit 1
16fi
17
Wink Savilled0332952010-05-29 13:00:38 -070018# Check that gtest is present. Usually it is already there since the
19# directory is set up as an SVN external.
20if test ! -e gtest; then
Jeff Davidsona3b2a6d2014-09-15 16:29:06 -070021 echo "Google Test not present. Fetching gtest-1.5.0 from the web..."
22 curl http://googletest.googlecode.com/files/gtest-1.5.0.tar.bz2 | tar jx
23 mv gtest-1.5.0 gtest
Wink Savilled0332952010-05-29 13:00:38 -070024fi
25
Wink Savillefbaaef92010-05-27 16:25:37 -070026set -ex
27
28# Temporary hack: Must change C runtime library to "multi-threaded DLL",
29# otherwise it will be set to "multi-threaded static" when MSVC upgrades
30# the project file to MSVC 2005/2008. vladl of Google Test says gtest will
31# probably change their default to match, then this will be unnecessary.
32# One of these mappings converts the debug configuration and the other
33# converts the release configuration. I don't know which is which.
34sed -i -e 's/RuntimeLibrary="5"/RuntimeLibrary="3"/g;
35 s/RuntimeLibrary="4"/RuntimeLibrary="2"/g;' gtest/msvc/*.vcproj
36
37# TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings.
38autoreconf -f -i -Wall,no-obsolete
39
40rm -rf autom4te.cache config.h.in~
41exit 0