From ecd7292d1bd3b183e4a98f013b04c5f5c26020e2 Mon Sep 17 00:00:00 2001 From: Jacob Bower Date: Fri, 23 Dec 2016 00:09:51 -0800 Subject: [PATCH] Enable making libfollyinit even when libdwarf is not available Summary: The hard requirement for libdwarf when building libfollyinit does not appear to be needed. Without libfollyinit, code with calls to folly::init() won't build. Notably this is breaking build/execution of tests + examples for the Watchman C++ client in Watchman. Reviewed By: yfeldblum Differential Revision: D4361498 fbshipit-source-id: f3586d8cdca36eda3634663e95a4a61d879de6cf --- folly/configure.ac | 11 ++--------- folly/experimental/Makefile.am | 2 ++ folly/init/Makefile.am | 6 +++++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/folly/configure.ac b/folly/configure.ac index 14bff8b9..a38ea92c 100644 --- a/folly/configure.ac +++ b/folly/configure.ac @@ -591,15 +591,7 @@ AC_CHECK_HEADERS([libdwarf/dwarf.h dwarf.h], [break]) have_libdwarf=no AS_IF([test "x${ac_cv_header_libdwarf_dwarf_h}" = xyes], [have_libdwarf=yes]) AS_IF([test "x${ac_cv_header_dwarf_h}" = xyes], [have_libdwarf=yes]) -if test "x${follytestmain}" = "xyes"; then - AS_IF([test "x${have_libdwarf}" = xno], [AC_MSG_ERROR([Please install libdwarf development library and headers])]) - AC_CHECK_HEADERS([elf.h],, AC_MSG_ERROR([Please install libelf development package])) - AC_CHECK_HEADERS([libunwind.h],, AC_MSG_ERROR([Please install libunwind development package])) -else - AS_IF([test "x${have_libdwarf}" = xno],, [use_follytestmain=no]) - AC_CHECK_HEADERS([elf.h],, [use_follytestmain=no]) - AC_CHECK_HEADERS([libunwind.h],, [use_follytestmain=no]) -fi + AC_ARG_ENABLE([mobile], AS_HELP_STRING([--enable-mobile], @@ -634,6 +626,7 @@ AM_CONDITIONAL([HAVE_BITS_FUNCTEXCEPT_H], [test "$ac_cv_header_bits_functexcept_ AM_CONDITIONAL([HAVE_EXTRANDOM_SFMT19937], [test "$folly_cv_prog_cc_have_extrandom_sfmt19937" = "yes"]) AM_CONDITIONAL([FOLLY_TESTMAIN], [test "x${use_follytestmain}" = "xyes"]) +AM_CONDITIONAL([HAVE_LIBDWARF], [test "x${have_libdwarf}" = "xyes"]) AM_CONDITIONAL([HAVE_BOOST_CONTEXT], [test "x${ax_cv_boost_context}" = "xyes"]) # remove pkg-config deps from dependent libraries diff --git a/folly/experimental/Makefile.am b/folly/experimental/Makefile.am index 4cdff7ed..f67636da 100644 --- a/folly/experimental/Makefile.am +++ b/folly/experimental/Makefile.am @@ -1 +1,3 @@ +if HAVE_LIBDWARF SUBDIRS = symbolizer +endif diff --git a/folly/init/Makefile.am b/folly/init/Makefile.am index 40320ac6..4b6367e0 100644 --- a/folly/init/Makefile.am +++ b/folly/init/Makefile.am @@ -2,6 +2,10 @@ SUBDIRS = . lib_LTLIBRARIES = libfollyinit.la +if HAVE_LIBDWARF +FOLLY_SYMBOLIZER=$(top_builddir)/experimental/symbolizer/libfollysymbolizer.la +endif + libfollyinit_la_SOURCES = Init.cpp -libfollyinit_la_LIBADD = $(top_builddir)/libfolly.la $(top_builddir)/experimental/symbolizer/libfollysymbolizer.la +libfollyinit_la_LIBADD = $(top_builddir)/libfolly.la $(FOLLY_SYMBOLIZER) libfollyinit_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION) -- 2.34.1