Commit 4bdddb9e authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot 0

folly: fix gflags<->glog configure check ordering

Summary:On systems that do not have gflags or glog installed globally,
but only locally as static libraries, our configure check failed for
glog because we were checking it prior to gflags.

glog depends on gflags, but when the libraries are static, there is
no explicit dependency information available and the linker fails.

This resolves the issue by checking for gflags first; this causes
configure to add an implicit `-lgflags` for the subsequent glog
tests.

Reviewed By: yfeldblum

Differential Revision: D3044138

fb-gh-sync-id: 5e07ce52842c6e4cff796560672bf950e2fafe6c
shipit-source-id: 5e07ce52842c6e4cff796560672bf950e2fafe6c
parent 5ae81138
......@@ -54,29 +54,6 @@ CXXFLAGS="$STD $CXXFLAGS"
# Checks for glog and gflags
# There are no symbols with C linkage, so we do a try-run
AC_HAVE_LIBRARY([glog],[],[AC_MSG_ERROR(
[Please install google-glog library])])
AC_CACHE_CHECK(
[for glog viability],
[folly_cv_prog_cc_glog],
[AC_RUN_IFELSE(
[AC_LANG_SOURCE[
#include <glog/logging.h>
int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
google::ShutdownGoogleLogging();
return 0;
}
]],
[folly_cv_prog_cc_glog=yes],
[folly_cv_prog_cc_glog=no]
)]
)
if test "$folly_cv_prog_cc_glog" != "yes"; then
AC_MSG_ERROR(["libglog invalid, see config.log for details"])
fi
AC_HAVE_LIBRARY([gflags],[],[AC_MSG_ERROR(
[Please install google-gflags library])])
AC_CACHE_CHECK(
......@@ -100,6 +77,29 @@ if test "$folly_cv_prog_cc_gflags" != "yes"; then
AC_MSG_ERROR(["libgflags invalid, see config.log for details"])
fi
AC_HAVE_LIBRARY([glog],[],[AC_MSG_ERROR(
[Please install google-glog library])])
AC_CACHE_CHECK(
[for glog viability],
[folly_cv_prog_cc_glog],
[AC_RUN_IFELSE(
[AC_LANG_SOURCE[
#include <glog/logging.h>
int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
google::ShutdownGoogleLogging();
return 0;
}
]],
[folly_cv_prog_cc_glog=yes],
[folly_cv_prog_cc_glog=no]
)]
)
if test "$folly_cv_prog_cc_glog" != "yes"; then
AC_MSG_ERROR(["libglog invalid, see config.log for details"])
fi
AC_CHECK_LIB(ssl,
SSL_ctrl,
[],
......
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