Browse Source

moved gtest sources to ext/gtest [Trac #3162]

Francis Dupont 10 years ago
parent
commit
055512758f
5 changed files with 30 additions and 15 deletions
  1. 9 4
      ChangeLog
  2. 1 7
      Makefile.am
  3. 7 4
      configure.ac
  4. 3 0
      ext/Makefile.am
  5. 10 0
      ext/gtest/Makefile.am

+ 9 - 4
ChangeLog

@@ -1,3 +1,7 @@
+850.	[build]		fdupont
+	Moved optional gtest sources to ext/gtest.
+	(Trac #3162, git xxx)
+
 849.	[bug]		tomek
 	DHCPv6 component now processes incoming vendor-class options
 	properly (packets are classified as VENDOR_CLASS_[content of the
@@ -44,10 +48,11 @@
 	(Trac #3546, git 6e68af7dfe15e4d461bf068f545d2bdaaa8fcfb0)
 
 840.	[func]		nicolas
-	PktFilterInet::send method now sets source IPv4 address explicitly.
-	This enabled perfdhcp to control its source address on systems that have
-	more than one address assigned to a given interface. Thanks to
-	Nicolas Chaigneau from Capgemini for providing this fix.
+	PktFilterInet::send method now sets source IPv4 address
+	explicitly.  This enabled perfdhcp to control its source address
+	on systems that have more than one address assigned to a given
+	interface. Thanks to Nicolas Chaigneau from Capgemini for
+	providing this fix.
 	(Github #2, git 6ac36ed7a1d97bcf52ffb2aec7cbf116e58e5803)
 
 839.	[doc]		adam

+ 1 - 7
Makefile.am

@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
 # ^^^^^^^^ This has to be the first line and cannot come later in this
 # Makefile.am due to some bork in some versions of autotools.
 
-SUBDIRS = compatcheck doc . src tests m4macros ext
+SUBDIRS = compatcheck doc . ext src tests m4macros
 USE_LCOV=@USE_LCOV@
 LCOV=@LCOV@
 GENHTML=@GENHTML@
@@ -447,9 +447,3 @@ CLEANFILES = $(abs_top_builddir)/logger_lockfile
 # config.h may be included by headers supplied for building user-written
 # hooks libraries, so we need to include it in the distribution.
 pkginclude_HEADERS = config.h
-
-if HAVE_GTEST_SOURCE
-noinst_LIBRARIES = libgtest.a
-libgtest_a_CXXFLAGS = $(GTEST_INCLUDES) $(AM_CXXFLAGS)
-nodist_libgtest_a_SOURCES = $(GTEST_SOURCE)/src/gtest-all.cc
-endif

+ 7 - 4
configure.ac

@@ -171,6 +171,9 @@ case "$host" in
 	# In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
 	KEA_CXXFLAGS="$KEA_CXXFLAGS -Wno-missing-braces"
 	;;
+*-apple-darwin*)
+	MULTITHREADING_FLAG=
+	;;
 *)
 	MULTITHREADING_FLAG=-pthread
 	;;
@@ -415,9 +418,8 @@ GTEST_INCLUDES=
 
 AC_ARG_WITH([gtest-source],
             [AS_HELP_STRING([--with-gtest-source=PATH],
-                            [location of the Googletest source, defaults to /usr/src/gtest])],
-            [enable_gtest="yes" ; GTEST_SOURCE="$withval"],
-            [GTEST_SOURCE="/usr/src/gtest"])
+                            [location of the Googletest source])],
+            [enable_gtest="yes" ; GTEST_SOURCE="$withval"])
 
 AC_ARG_WITH([gtest],
 	    [AS_HELP_STRING([--with-gtest=PATH],
@@ -1088,7 +1090,7 @@ if test "x$enable_gtest" = "xyes" ; then
                [AC_MSG_ERROR([no gtest source at $GTEST_SOURCE])])
           fi
           have_gtest_source=yes
-          GTEST_LDFLAGS="\$(top_builddir)/libgtest.a"
+          GTEST_LDFLAGS="\$(top_builddir)/ext/gtest/libgtest.a"
           DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest-source=$GTEST_SOURCE"
           GTEST_INCLUDES="-I$GTEST_SOURCE -I$GTEST_SOURCE/include"
           # See $GTEST_SOURCE/include/gtest/internal/gtest-port.h
@@ -1358,6 +1360,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
                  doc/version.ent
                  ext/asio/asio/Makefile
                  ext/asio/Makefile
+		 ext/gtest/Makefile
                  ext/Makefile
                  m4macros/Makefile
                  Makefile

+ 3 - 0
ext/Makefile.am

@@ -1,4 +1,7 @@
 SUBDIRS = . asio
+if HAVE_GTEST_SOURCE
+SUBDIRS += gtest
+endif
 
 # As we are copying ASIO headers to the installation directory, copy across
 # the licence file as well.

+ 10 - 0
ext/gtest/Makefile.am

@@ -0,0 +1,10 @@
+SUBDIRS = .
+
+CLEANFILES = gtest-all.cc
+
+noinst_LIBRARIES = libgtest.a
+libgtest_a_CXXFLAGS = $(GTEST_INCLUDES) $(AM_CXXFLAGS)
+nodist_libgtest_a_SOURCES = gtest-all.cc
+
+gtest-all.cc: $(GTEST_SOURCE)/src/gtest-all.cc
+	cp -p $< $@