Commit 754118c4 authored by Denis Samoylov's avatar Denis Samoylov Committed by facebook-github-bot-4

Make advanced init function for test optional

Summary: In order to avoid mandatory dependncy on elf, dwarf, unwind made new init function optional

Reviewed By: markisaa

Differential Revision: D2878545

fb-gh-sync-id: f66d3884a531dcf56fc1432330325ab45b149d7f
parent a8faf480
......@@ -50,7 +50,13 @@ sudo apt-get install \
zlib1g-dev \
binutils-dev \
libjemalloc-dev \
libssl-dev \
libssl-dev
```
If advanced dubugging functionality for tests are required
```
sudo apt-get install \
libunwind8-dev \
libelf-dev \
libdwarf-dev
......@@ -166,6 +172,8 @@ Other Linux distributions
- double-conversion-devel
- openssl-devel
- libevent-devel
Optional
- libdwarf-dev
- libelf-dev
- libunwind8-dev
if HAVE_LINUX
if FOLLY_TESTMAIN
SUBDIRS = . experimental init test
else
SUBDIRS = . test
......
......@@ -468,9 +468,21 @@ AC_CHECK_HEADER([snappy.h], AC_CHECK_LIB([snappy], [main]))
AC_CHECK_HEADER([zlib.h], AC_CHECK_LIB([z], [main]))
AC_CHECK_HEADER([lzma.h], AC_CHECK_LIB([lzma], [main]))
AC_CHECK_HEADER([zstd.h], AC_CHECK_LIB([zstd], [main]))
AC_CHECK_HEADERS([libdwarf.h dwarf.h],, AC_MSG_ERROR([Please install libdwarf development package]))
AC_CHECK_HEADERS([libelf.h elf.h],, AC_MSG_ERROR([Please install libelf development package]))
AC_CHECK_HEADERS(libunwind.h, ac_cv_have_libunwind_h=1, ac_cv_have_libunwind_h=0)
AC_ARG_ENABLE([follytestmain],
AS_HELP_STRING([--enable-follytestmain], [enables using main function from folly for tests]),
[follytestmain=${enableval}], [follytestmain=no])
use_follytestmain=yes
if test "x${follytestmain}" = "xyes"; then
AC_CHECK_HEADERS([libdwarf.h dwarf.h],, AC_MSG_ERROR([Please install libdwarf development package]))
AC_CHECK_HEADERS([libelf.h elf.h],, AC_MSG_ERROR([Please install libelf development package]))
AC_CHECK_HEADERS([libunwind.h],, AC_MSG_ERROR([Please install libinwind development package]))
else
AC_CHECK_HEADERS([libdwarf.h dwarf.h],, [use_follytestmain=no])
AC_CHECK_HEADERS([libelf.h elf.h],, [use_follytestmain=no])
AC_CHECK_HEADERS([libunwind.h],, [use_follytestmain=no])
fi
# Include directory that contains "folly" so #include <folly/Foo.h> works
AM_CPPFLAGS='-I$(top_srcdir)/..'
......@@ -493,6 +505,7 @@ AM_CONDITIONAL([HAVE_WEAK_SYMBOLS],
AM_CONDITIONAL([HAVE_BITS_FUNCTEXCEPT], [test "$ac_cv_header_bits_functexcept_h" = "yes"])
AM_CONDITIONAL([HAVE_EXTRANDOM_SFMT19937],
[test "$folly_cv_prog_cc_have_extrandom_sfmt19937" = "yes"])
AM_CONDITIONAL([FOLLY_TESTMAIN], [test "x${use_follytestmain}" = "xyes"])
# Output
AC_CONFIG_FILES([Makefile
......
......@@ -20,7 +20,7 @@ check_PROGRAMS =
libgtest_la_CPPFLAGS = -Igtest-1.7.0 -Igtest-1.7.0/src
libgtest_la_SOURCES = gtest-1.7.0/src/gtest-all.cc
if HAVE_LINUX
if FOLLY_TESTMAIN
libfollytestmain_la_CPPFLAGS = $(AM_CPPFLAGS) $(libgtest_la_CPPFLAGS)
libfollytestmain_la_SOURCES = $(libgtest_la_SOURCES) common/TestMain.cpp
libfollytestmain_la_LIBADD = $(top_builddir)/init/libfollyinit.la $(top_builddir)/libfolly.la
......
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