Commit 281b1d21 by shiqian

More tweaks to the build script.

parent a92e4962
...@@ -7,6 +7,10 @@ SUBDIRS = $(subdirs) ...@@ -7,6 +7,10 @@ SUBDIRS = $(subdirs)
# Scripts and utilities to be installed by 'make install'. # Scripts and utilities to be installed by 'make install'.
dist_bin_SCRIPTS = scripts/gmock_doctor.py dist_bin_SCRIPTS = scripts/gmock_doctor.py
bin_SCRIPTS = scripts/gmock-config
# This is generated by the configure script, so clean it for distribution.
DISTCLEANFILES = scripts/gmock-config
# We define the global AM_CPPFLAGS as everything we compile includes from these # We define the global AM_CPPFLAGS as everything we compile includes from these
# directories. # directories.
......
...@@ -40,10 +40,8 @@ testing framework for writing tests. Currently Google Mock only works ...@@ -40,10 +40,8 @@ testing framework for writing tests. Currently Google Mock only works
with Google Test (http://code.google.com/p/googletest/), although with Google Test (http://code.google.com/p/googletest/), although
eventually we plan to support other C++ testing frameworks. You can eventually we plan to support other C++ testing frameworks. You can
use either the copy of Google Test that comes with Google Mock, or a use either the copy of Google Test that comes with Google Mock, or a
compatible version you already have. compatible version you already have. This version of Google Mock
requires Google Test 1.2.1.
TODO(wan@google.com): describe which Google Test versions are
compatible with the latest Google Mock release.
Google Mock depends on advanced C++ features and thus requires a more Google Mock depends on advanced C++ features and thus requires a more
modern compiler. The following are needed to use Google Mock: modern compiler. The following are needed to use Google Mock:
...@@ -101,20 +99,23 @@ or for a release version X.Y.*'s branch: ...@@ -101,20 +99,23 @@ or for a release version X.Y.*'s branch:
Next you will need to prepare the GNU Autotools build system, if you Next you will need to prepare the GNU Autotools build system, if you
are using Linux or Mac OS X. Enter the target directory of the are using Linux or Mac OS X. Enter the target directory of the
checkout command you used ('gmock-svn' or 'gmock-X.Y-svn' above) and checkout command you used ('gmock-svn' or 'gmock-X.Y-svn' above) and
proceed with the following commands: proceed with the following command:
$ autoreconf -fvi
Once you have completed this step, you are ready to build the library.
Note that you should need to complete this step only once. The sub-
sequent `make' invocations will automatically re-generate the bits of
the build system that need to be changed.
$ aclocal-1.9 # Where "1.9" must match the following automake command. If your system uses older versions of the autotools, the above command will
$ libtoolize -c # Use "glibtoolize -c" instead on Mac OS X. fail. You may need to explicitly specify a version to use. For instance, if
$ autoheader you have both GNU Automake 1.4 and 1.9 installed and `automake' would invoke
$ automake-1.9 -ac # See Automake version requirements above. the 1.4, use instead:
$ autoconf
While this is a bit complicated, it will most often be automatically re-run by $ AUTOMAKE=automake-1.9 ACLOCAL=aclocal-1.9 autoreconf -fvi
your "make" invocations, so in practice you shouldn't need to worry too much.
Once you have completed these steps, you are ready to build the library.
TODO(chandlerc@google.com): Update the above with instructions on Make sure you're using the same version of automake and aclocal.
preparing the build system for Google Test.
### Source Package: ### ### Source Package: ###
Google Mock is also released in source packages which can be downloaded from Google Mock is also released in source packages which can be downloaded from
......
...@@ -9,6 +9,7 @@ AC_CONFIG_SRCDIR([./COPYING]) ...@@ -9,6 +9,7 @@ AC_CONFIG_SRCDIR([./COPYING])
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([build-aux/config.h]) AC_CONFIG_HEADERS([build-aux/config.h])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([scripts/gmock-config], [chmod +x scripts/gmock-config])
# Initialize Automake with various options. We require at least v1.9, prevent # Initialize Automake with various options. We require at least v1.9, prevent
# pedantic complaints about package files, and enable various distribution # pedantic complaints about package files, and enable various distribution
...@@ -79,10 +80,7 @@ AC_ARG_VAR([GTEST_VERSION], ...@@ -79,10 +80,7 @@ AC_ARG_VAR([GTEST_VERSION],
[The version of Google Test available.]) [The version of Google Test available.])
HAVE_BUILT_GTEST="no" HAVE_BUILT_GTEST="no"
# TODO(chandlerc@google.com): This is arbitrary, but we will need to introduce GTEST_MIN_VERSION="1.2.1"
# some features to the GoogleTest build system to help support GoogleMock, and
# at that point it will become more meaningful.
GTEST_MIN_VERSION="1.0.0"
AS_IF([test "x${enable_external_gtest}" = "xyes"], AS_IF([test "x${enable_external_gtest}" = "xyes"],
[# Begin filling in variables as we are able. [# Begin filling in variables as we are able.
...@@ -111,11 +109,13 @@ AS_IF([test "x${HAVE_BUILT_GTEST}" = "xyes"], ...@@ -111,11 +109,13 @@ AS_IF([test "x${HAVE_BUILT_GTEST}" = "xyes"],
GTEST_LIBS=`${GTEST_CONFIG} --libs` GTEST_LIBS=`${GTEST_CONFIG} --libs`
GTEST_VERSION=`${GTEST_CONFIG} --version`], GTEST_VERSION=`${GTEST_CONFIG} --version`],
[AC_CONFIG_SUBDIRS([gtest]) [AC_CONFIG_SUBDIRS([gtest])
GTEST_CONFIG='$(builddir)/gtest/scripts/gtest-config' # GTEST_CONFIG needs to be executable both in a Makefile environmont and
GTEST_CPPFLAGS='-I$(srcdir)/gtest/include -I$(srcdir)/gtest' # in a shell script environment, so resolve an absolute path for it here.
GTEST_CONFIG="`pwd -P`/gtest/scripts/gtest-config"
GTEST_CPPFLAGS='-I$(top_srcdir)/gtest/include'
GTEST_CXXFLAGS='-g' GTEST_CXXFLAGS='-g'
GTEST_LDFLAGS='' GTEST_LDFLAGS=''
GTEST_LIBS='$(builddir)/gtest/lib/libgtest.la' GTEST_LIBS='$(top_builddir)/gtest/lib/libgtest.la'
GTEST_VERSION="${GTEST_MIN_VERSION}"]) GTEST_VERSION="${GTEST_MIN_VERSION}"])
# TODO(chandlerc@google.com) Check the types, structures, and other compiler # TODO(chandlerc@google.com) Check the types, structures, and other compiler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment